From 8b59940fa31fc69fece10de170e038915d834004 Mon Sep 17 00:00:00 2001 From: Pedro Date: Wed, 23 Dec 2015 17:02:45 +0100 Subject: [PATCH] include bison and flex generated code in release --- src/parser/.gitignore | 4 - src/parser/bison_parser.cpp | 2884 +++++++++++++++++++++++++++ src/parser/bison_parser.h | 269 +++ src/parser/flex_lexer.cpp | 3696 +++++++++++++++++++++++++++++++++++ src/parser/flex_lexer.h | 360 ++++ 5 files changed, 7209 insertions(+), 4 deletions(-) create mode 100644 src/parser/bison_parser.cpp create mode 100644 src/parser/bison_parser.h create mode 100644 src/parser/flex_lexer.cpp create mode 100644 src/parser/flex_lexer.h diff --git a/src/parser/.gitignore b/src/parser/.gitignore index 19c7633..0f274e7 100644 --- a/src/parser/.gitignore +++ b/src/parser/.gitignore @@ -1,5 +1 @@ -flex_lexer.c* -flex_lexer.h -bison_parser.c* -bison_parser.h *.output \ No newline at end of file diff --git a/src/parser/bison_parser.cpp b/src/parser/bison_parser.cpp new file mode 100644 index 0000000..2fa2e11 --- /dev/null +++ b/src/parser/bison_parser.cpp @@ -0,0 +1,2884 @@ +/* A Bison parser, made by GNU Bison 3.0.2. */ + +/* Bison implementation for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "3.0.2" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 2 + +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + +/* Substitute the type names. */ +#define YYSTYPE HSQL_STYPE +#define YYLTYPE HSQL_LTYPE +/* Substitute the variable and function names. */ +#define yyparse hsql_parse +#define yylex hsql_lex +#define yyerror hsql_error +#define yydebug hsql_debug +#define yynerrs hsql_nerrs + + +/* Copy the first part of user declarations. */ +#line 1 "bison_parser.y" /* yacc.c:339 */ + +/** + * bison_parser.y + * defines bison_parser.h + * outputs bison_parser.c + * + * Grammar File Spec: http://dinosaur.compilertools.net/bison/bison_6.html + * + */ +/********************************* + ** Section 1: C Declarations + *********************************/ + +#include "../sqltypes.h" +#include "bison_parser.h" +#include "flex_lexer.h" + +#include + +using namespace hsql; + +int yyerror(YYLTYPE* llocp, SQLStatementList** result, yyscan_t scanner, const char *msg) { + + SQLStatementList* list = new SQLStatementList(); + list->isValid = false; + list->parser_msg = strdup(msg); + list->error_line = llocp->first_line; + list->error_col = llocp->first_column; + + *result = list; + return 0; +} + + + + +#line 111 "bison_parser.cpp" /* yacc.c:339 */ + +# ifndef YY_NULLPTR +# if defined __cplusplus && 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 1 +#endif + +/* In a future release of Bison, this section will be replaced + by #include "bison_parser.h". */ +#ifndef YY_HSQL_BISON_PARSER_H_INCLUDED +# define YY_HSQL_BISON_PARSER_H_INCLUDED +/* Debug traces. */ +#ifndef HSQL_DEBUG +# if defined YYDEBUG +#if YYDEBUG +# define HSQL_DEBUG 1 +# else +# define HSQL_DEBUG 0 +# endif +# else /* ! defined YYDEBUG */ +# define HSQL_DEBUG 0 +# endif /* ! defined YYDEBUG */ +#endif /* ! defined HSQL_DEBUG */ +#if HSQL_DEBUG +extern int hsql_debug; +#endif +/* "%code requires" blocks. */ +#line 43 "bison_parser.y" /* yacc.c:355 */ + +// %code requires block +#include "parser_typedef.h" + +// Auto update column and line number +#define YY_USER_ACTION \ + yylloc->first_line = yylloc->last_line; \ + yylloc->first_column = yylloc->last_column; \ + for(int i = 0; yytext[i] != '\0'; i++) { \ + yylloc->total_column++; \ + if(yytext[i] == '\n') { \ + yylloc->last_line++; \ + yylloc->last_column = 0; \ + } \ + else { \ + yylloc->last_column++; \ + } \ + } + +#line 169 "bison_parser.cpp" /* yacc.c:355 */ + +/* Token type. */ +#ifndef HSQL_TOKENTYPE +# define HSQL_TOKENTYPE + enum hsql_tokentype + { + SQL_IDENTIFIER = 258, + SQL_STRING = 259, + SQL_FLOATVAL = 260, + SQL_INTVAL = 261, + SQL_NOTEQUALS = 262, + SQL_LESSEQ = 263, + SQL_GREATEREQ = 264, + SQL_DEALLOCATE = 265, + SQL_PARAMETERS = 266, + SQL_INTERSECT = 267, + SQL_TEMPORARY = 268, + SQL_TIMESTAMP = 269, + SQL_DISTINCT = 270, + SQL_NVARCHAR = 271, + SQL_RESTRICT = 272, + SQL_TRUNCATE = 273, + SQL_ANALYZE = 274, + SQL_BETWEEN = 275, + SQL_CASCADE = 276, + SQL_COLUMNS = 277, + SQL_CONTROL = 278, + SQL_DEFAULT = 279, + SQL_EXECUTE = 280, + SQL_EXPLAIN = 281, + SQL_HISTORY = 282, + SQL_INTEGER = 283, + SQL_NATURAL = 284, + SQL_PREPARE = 285, + SQL_PRIMARY = 286, + SQL_SCHEMAS = 287, + SQL_SPATIAL = 288, + SQL_VIRTUAL = 289, + SQL_BEFORE = 290, + SQL_COLUMN = 291, + SQL_CREATE = 292, + SQL_DELETE = 293, + SQL_DIRECT = 294, + SQL_DOUBLE = 295, + SQL_ESCAPE = 296, + SQL_EXCEPT = 297, + SQL_EXISTS = 298, + SQL_GLOBAL = 299, + SQL_HAVING = 300, + SQL_IMPORT = 301, + SQL_INSERT = 302, + SQL_ISNULL = 303, + SQL_OFFSET = 304, + SQL_RENAME = 305, + SQL_SCHEMA = 306, + SQL_SELECT = 307, + SQL_SORTED = 308, + SQL_TABLES = 309, + SQL_UNIQUE = 310, + SQL_UNLOAD = 311, + SQL_UPDATE = 312, + SQL_VALUES = 313, + SQL_AFTER = 314, + SQL_ALTER = 315, + SQL_CROSS = 316, + SQL_DELTA = 317, + SQL_GROUP = 318, + SQL_INDEX = 319, + SQL_INNER = 320, + SQL_LIMIT = 321, + SQL_LOCAL = 322, + SQL_MERGE = 323, + SQL_MINUS = 324, + SQL_ORDER = 325, + SQL_OUTER = 326, + SQL_RIGHT = 327, + SQL_TABLE = 328, + SQL_UNION = 329, + SQL_USING = 330, + SQL_WHERE = 331, + SQL_CALL = 332, + SQL_DATE = 333, + SQL_DESC = 334, + SQL_DROP = 335, + SQL_FILE = 336, + SQL_FROM = 337, + SQL_FULL = 338, + SQL_HASH = 339, + SQL_HINT = 340, + SQL_INTO = 341, + SQL_JOIN = 342, + SQL_LEFT = 343, + SQL_LIKE = 344, + SQL_LOAD = 345, + SQL_NULL = 346, + SQL_PART = 347, + SQL_PLAN = 348, + SQL_SHOW = 349, + SQL_TEXT = 350, + SQL_TIME = 351, + SQL_VIEW = 352, + SQL_WITH = 353, + SQL_ADD = 354, + SQL_ALL = 355, + SQL_AND = 356, + SQL_ASC = 357, + SQL_CSV = 358, + SQL_FOR = 359, + SQL_INT = 360, + SQL_KEY = 361, + SQL_NOT = 362, + SQL_OFF = 363, + SQL_SET = 364, + SQL_TBL = 365, + SQL_TOP = 366, + SQL_AS = 367, + SQL_BY = 368, + SQL_IF = 369, + SQL_IN = 370, + SQL_IS = 371, + SQL_OF = 372, + SQL_ON = 373, + SQL_OR = 374, + SQL_TO = 375, + SQL_EQUALS = 376, + SQL_LESS = 377, + SQL_GREATER = 378, + SQL_NOTNULL = 379, + SQL_UMINUS = 380 + }; +#endif + +/* Value type. */ +#if ! defined HSQL_STYPE && ! defined HSQL_STYPE_IS_DECLARED +typedef union HSQL_STYPE HSQL_STYPE; +union HSQL_STYPE +{ +#line 99 "bison_parser.y" /* yacc.c:355 */ + + double fval; + int64_t ival; + char* sval; + uint uval; + bool bval; + + hsql::SQLStatement* statement; + hsql::SelectStatement* select_stmt; + hsql::ImportStatement* import_stmt; + hsql::CreateStatement* create_stmt; + hsql::InsertStatement* insert_stmt; + hsql::DeleteStatement* delete_stmt; + hsql::UpdateStatement* update_stmt; + hsql::DropStatement* drop_stmt; + hsql::PrepareStatement* prep_stmt; + hsql::ExecuteStatement* exec_stmt; + + hsql::TableRef* table; + hsql::Expr* expr; + hsql::OrderDescription* order; + hsql::OrderType order_type; + hsql::LimitDescription* limit; + hsql::ColumnDefinition* column_t; + hsql::GroupByDescription* group_t; + hsql::UpdateClause* update_t; + + hsql::SQLStatementList* stmt_list; + + std::vector* str_vec; + std::vector* table_vec; + std::vector* column_vec; + std::vector* update_vec; + std::vector* expr_vec; + +#line 343 "bison_parser.cpp" /* yacc.c:355 */ +}; +# define HSQL_STYPE_IS_TRIVIAL 1 +# define HSQL_STYPE_IS_DECLARED 1 +#endif + +/* Location type. */ +#if ! defined HSQL_LTYPE && ! defined HSQL_LTYPE_IS_DECLARED +typedef struct HSQL_LTYPE HSQL_LTYPE; +struct HSQL_LTYPE +{ + int first_line; + int first_column; + int last_line; + int last_column; +}; +# define HSQL_LTYPE_IS_DECLARED 1 +# define HSQL_LTYPE_IS_TRIVIAL 1 +#endif + + + +int hsql_parse (hsql::SQLStatementList** result, yyscan_t scanner); + +#endif /* !YY_HSQL_BISON_PARSER_H_INCLUDED */ + +/* Copy the second part of user declarations. */ + +#line 371 "bison_parser.cpp" /* yacc.c:358 */ + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#else +typedef signed char yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) +# endif +# endif +# ifndef YY_ +# define YY_(Msgid) Msgid +# endif +#endif + +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(E) ((void) (E)) +#else +# define YYUSE(E) /* empty */ +#endif + +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS +# include /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined EXIT_SUCCESS +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined EXIT_SUCCESS +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined HSQL_LTYPE_IS_TRIVIAL && HSQL_LTYPE_IS_TRIVIAL \ + && defined HSQL_STYPE_IS_TRIVIAL && HSQL_STYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; + YYLTYPE yyls_alloc; +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + + 2 * YYSTACK_GAP_MAXIMUM) + +# define YYCOPY_NEEDED 1 + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) + +#endif + +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from SRC to DST. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) +# else +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 46 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 449 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 146 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 67 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 145 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 257 + +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 380 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 132, 2, 2, + 137, 138, 130, 128, 144, 129, 139, 131, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 141, 140, + 123, 121, 124, 145, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 135, 2, 136, 133, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 142, 2, 143, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 122, 125, 126, 127, + 134 +}; + +#if HSQL_DEBUG + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 227, 227, 234, 235, 239, 244, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 265, 270, 278, 282, + 294, 302, 306, 316, 322, 331, 332, 336, 337, 341, + 348, 349, 350, 351, 361, 365, 377, 385, 397, 403, + 413, 414, 424, 433, 434, 438, 450, 451, 455, 456, + 460, 465, 477, 478, 479, 483, 494, 495, 499, 504, + 509, 510, 514, 519, 523, 524, 527, 528, 532, 533, + 534, 539, 540, 541, 548, 549, 553, 554, 558, 565, + 566, 567, 568, 569, 573, 574, 575, 579, 580, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 599, 600, 601, 602, 603, 604, 608, 612, 613, 617, + 618, 619, 623, 628, 629, 633, 637, 642, 653, 654, + 664, 665, 671, 676, 677, 682, 692, 700, 701, 706, + 707, 711, 712, 720, 732, 733, 734, 735, 736, 742, + 748, 752, 761, 762, 767, 768 +}; +#endif + +#if HSQL_DEBUG || YYERROR_VERBOSE || 1 +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "IDENTIFIER", "STRING", "FLOATVAL", + "INTVAL", "NOTEQUALS", "LESSEQ", "GREATEREQ", "DEALLOCATE", "PARAMETERS", + "INTERSECT", "TEMPORARY", "TIMESTAMP", "DISTINCT", "NVARCHAR", + "RESTRICT", "TRUNCATE", "ANALYZE", "BETWEEN", "CASCADE", "COLUMNS", + "CONTROL", "DEFAULT", "EXECUTE", "EXPLAIN", "HISTORY", "INTEGER", + "NATURAL", "PREPARE", "PRIMARY", "SCHEMAS", "SPATIAL", "VIRTUAL", + "BEFORE", "COLUMN", "CREATE", "DELETE", "DIRECT", "DOUBLE", "ESCAPE", + "EXCEPT", "EXISTS", "GLOBAL", "HAVING", "IMPORT", "INSERT", "ISNULL", + "OFFSET", "RENAME", "SCHEMA", "SELECT", "SORTED", "TABLES", "UNIQUE", + "UNLOAD", "UPDATE", "VALUES", "AFTER", "ALTER", "CROSS", "DELTA", + "GROUP", "INDEX", "INNER", "LIMIT", "LOCAL", "MERGE", "MINUS", "ORDER", + "OUTER", "RIGHT", "TABLE", "UNION", "USING", "WHERE", "CALL", "DATE", + "DESC", "DROP", "FILE", "FROM", "FULL", "HASH", "HINT", "INTO", "JOIN", + "LEFT", "LIKE", "LOAD", "NULL", "PART", "PLAN", "SHOW", "TEXT", "TIME", + "VIEW", "WITH", "ADD", "ALL", "AND", "ASC", "CSV", "FOR", "INT", "KEY", + "NOT", "OFF", "SET", "TBL", "TOP", "AS", "BY", "IF", "IN", "IS", "OF", + "ON", "OR", "TO", "'='", "EQUALS", "'<'", "'>'", "LESS", "GREATER", + "NOTNULL", "'+'", "'-'", "'*'", "'/'", "'%'", "'^'", "UMINUS", "'['", + "']'", "'('", "')'", "'.'", "';'", "':'", "'{'", "'}'", "','", "'?'", + "$accept", "input", "statement_list", "statement", + "preparable_statement", "prepare_statement", "execute_statement", + "import_statement", "import_file_type", "file_path", "create_statement", + "opt_not_exists", "column_def_commalist", "column_def", "column_type", + "drop_statement", "delete_statement", "truncate_statement", + "insert_statement", "opt_column_list", "update_statement", + "update_clause_commalist", "update_clause", "select_statement", + "select_with_paren", "select_no_paren", "set_operator", "select_clause", + "opt_distinct", "select_list", "from_clause", "opt_where", "opt_group", + "opt_having", "opt_order", "opt_order_type", "opt_limit", "expr_list", + "literal_list", "expr_alias", "expr", "scalar_expr", "unary_expr", + "binary_expr", "comp_expr", "function_expr", "column_name", "literal", + "string_literal", "num_literal", "int_literal", "star_expr", + "placeholder_expr", "table_ref", "table_ref_atomic", + "table_ref_commalist", "table_ref_name", "table_ref_name_no_alias", + "table_name", "alias", "opt_alias", "join_clause", "opt_join_type", + "join_table", "join_condition", "opt_semicolon", "ident_commalist", YY_NULLPTR +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ +static const yytype_uint16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 61, 376, 60, 62, 377, 378, 379, 43, 45, + 42, 47, 37, 94, 380, 91, 93, 40, 41, 46, + 59, 58, 123, 125, 44, 63 +}; +# endif + +#define YYPACT_NINF -209 + +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-209))) + +#define YYTABLE_NINF -141 + +#define yytable_value_is_error(Yytable_value) \ + (!!((Yytable_value) == (-141))) + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +static const yytype_int16 yypact[] = +{ + 212, 0, 32, 35, 72, -26, -3, -1, -6, 68, + 32, 25, -34, 99, -36, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, 80, + 102, -33, -209, -30, -99, 10, 32, 16, 32, -209, + 8, 14, -209, 32, -24, -13, -209, 212, -209, -209, + -209, 13, -209, 60, 62, -209, 126, 11, 64, 212, + 27, 32, 67, -209, 55, 18, -66, -209, -209, -209, + 8, 8, -209, 8, -209, 65, 2, -209, 124, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, 148, -209, -209, -209, -209, 8, 87, 152, -209, + -209, -112, -209, -209, -36, 116, -59, 8, -209, 159, + 163, -25, 68, 172, 280, -45, 41, 3, 67, 8, + -209, 8, 8, 8, 8, 8, 89, 173, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, -209, -209, + 73, -54, -209, 183, 62, 136, -209, 11, 45, -209, + 83, 193, 231, 111, -209, -209, -107, 61, -209, 8, + -209, -209, -34, -209, 66, 96, 6, -209, 5, 141, + -209, 316, 252, 252, 316, 280, 8, -209, 267, 316, + 252, 252, -45, -45, 75, 75, 75, -209, 11, 148, + -209, -209, -209, -209, -209, 152, -209, -209, 118, 44, + -98, -209, 32, -209, 202, 11, 88, 76, 3, -209, + -209, -209, -209, -209, 119, 110, -209, 316, -209, -209, + -209, 159, -209, -209, -209, -209, -209, -209, 193, -209, + -209, -93, -209, 6, -209, 71, 4, 8, -209, -209, + -209, 115, 3, -34, -209, 106, -35, -209, 90, 8, + 8, -209, 6, 231, -209, 231, -209 +}; + + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, + 0, 0, 0, 0, 143, 3, 6, 5, 15, 8, + 9, 14, 11, 12, 10, 13, 7, 46, 47, 67, + 0, 127, 37, 18, 0, 26, 0, 0, 0, 56, + 0, 0, 126, 0, 0, 0, 1, 142, 2, 53, + 54, 0, 52, 0, 73, 35, 0, 0, 0, 0, + 0, 0, 61, 21, 0, 41, 107, 112, 113, 115, + 0, 0, 116, 0, 117, 0, 58, 74, 132, 80, + 81, 82, 89, 83, 84, 86, 109, 110, 114, 85, + 111, 0, 34, 49, 48, 4, 0, 67, 0, 50, + 128, 0, 76, 16, 143, 0, 0, 0, 36, 0, + 0, 0, 57, 0, 88, 87, 0, 0, 61, 0, + 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 131, 78, + 0, 61, 43, 70, 73, 71, 19, 0, 0, 25, + 0, 0, 60, 0, 22, 144, 0, 0, 39, 0, + 108, 79, 0, 59, 118, 120, 132, 122, 138, 63, + 75, 101, 104, 105, 98, 96, 0, 129, 97, 100, + 102, 103, 91, 90, 93, 92, 94, 95, 0, 0, + 42, 69, 68, 66, 51, 0, 77, 17, 0, 0, + 0, 27, 0, 40, 0, 0, 0, 0, 0, 125, + 134, 135, 137, 136, 0, 0, 55, 99, 45, 44, + 72, 0, 31, 32, 33, 30, 29, 24, 0, 20, + 145, 0, 106, 0, 123, 119, 0, 0, 23, 28, + 38, 121, 0, 0, 140, 0, 65, 124, 0, 0, + 0, 62, 0, 141, 133, 64, 139 +}; + + /* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -209, -209, 168, 182, 174, -209, -209, -209, -209, 12, + -209, -209, -209, 7, -209, -209, -209, -209, -209, -209, + -209, -209, 52, -143, 222, 9, -209, 191, 134, -209, + -209, -89, -209, -209, 154, -209, 121, 26, 63, 147, + -68, -209, -209, -209, -209, -209, -209, -53, -108, -209, + -78, -209, -209, -209, -184, -209, 31, -209, -2, -208, + 104, -209, -209, 37, -209, 167, -209 +}; + + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 13, 14, 15, 16, 17, 18, 19, 64, 153, + 20, 61, 200, 201, 226, 21, 22, 23, 24, 111, + 25, 141, 142, 26, 27, 28, 53, 29, 40, 75, + 118, 108, 216, 251, 54, 193, 99, 76, 101, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 163, 164, 235, 165, 41, 166, 138, + 139, 167, 214, 168, 254, 48, 156 +}; + + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ +static const yytype_int16 yytable[] = +{ + 32, 154, 114, 115, 102, 116, 31, 31, 42, 120, + 250, 66, 67, 68, 69, 67, 68, 69, 9, 207, + 145, 45, 107, 150, 234, 241, 146, 9, 143, 169, + 30, 203, 147, 157, 62, 31, 65, 204, 33, 152, + 227, 92, 58, 59, 256, 240, 228, 35, 121, 122, + 123, 147, 190, 171, 172, 173, 174, 175, 247, 106, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 210, 112, 222, 113, 1, 34, 211, 212, 151, 36, + 38, 37, 2, 39, 223, 134, 135, 136, 137, 3, + 189, 206, 49, 213, 196, 121, 122, 123, 43, 46, + 248, 5, 6, 12, 47, 55, 56, 57, 217, 119, + 7, 8, 9, 154, 93, 70, 9, 220, 127, 63, + 158, 10, 50, 91, 60, 94, 96, 120, 98, 100, + 124, 121, 122, 123, 105, 218, 109, 71, 72, 224, + 162, 243, 125, 107, 11, 73, 119, 117, 126, 225, + 51, 140, 102, 74, 52, 110, 74, 51, 69, 149, + 128, -140, 129, 67, 130, 131, 155, -140, -140, 132, + 133, 134, 135, 136, 137, 160, 177, 124, 176, 161, + -139, 253, 255, -140, -140, 195, -139, -139, 197, 125, + 121, 122, 123, 198, 188, 126, 199, 202, 205, 221, + 229, 12, -139, -139, 215, 230, 236, 128, 137, 129, + 208, 130, 131, 124, 233, 242, 132, 133, 134, 135, + 136, 137, 1, 237, 249, 125, 232, 104, 252, 95, + 2, 126, 103, 238, 44, 239, 127, 3, 121, 122, + 123, 219, 4, 128, 97, 129, 159, 130, 131, 5, + 6, 144, 132, 133, 134, 135, 136, 137, 7, 8, + -141, -141, 191, 246, 9, 194, 170, 244, 231, 10, + 209, 148, 124, 245, 121, 122, 123, 0, 0, 0, + 0, 0, 0, 0, 125, 192, 0, 121, 122, 123, + 126, 0, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 128, 0, 129, 0, 130, 131, 0, 0, + 0, 132, 133, 134, 135, 136, 137, 0, 0, 0, + 124, 0, 0, 121, 122, 123, 0, 0, 0, 0, + 0, 0, 125, 0, 0, 0, 0, 0, 126, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, + 128, 0, 129, 0, 130, 131, 124, 0, 0, 132, + 133, 134, 135, 136, 137, 0, 0, 0, 125, 124, + 0, 0, 0, 0, 126, -141, -141, 0, 0, 0, + 132, 133, 134, 135, 136, 137, 0, 126, 129, 0, + 130, 131, 0, 0, 0, 132, 133, 134, 135, 136, + 137, 129, 0, 130, 131, 124, 0, 0, 132, 133, + 134, 135, 136, 137, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 129, 0, 130, + 131, 0, 0, 0, 132, 133, 134, 135, 136, 137 +}; + +static const yytype_int16 yycheck[] = +{ + 2, 109, 70, 71, 57, 73, 3, 3, 10, 3, + 45, 3, 4, 5, 6, 4, 5, 6, 52, 162, + 98, 12, 76, 82, 208, 233, 138, 52, 96, 118, + 30, 138, 144, 58, 36, 3, 38, 144, 3, 107, + 138, 43, 141, 142, 252, 138, 144, 73, 7, 8, + 9, 144, 141, 121, 122, 123, 124, 125, 242, 61, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 65, 137, 28, 139, 10, 3, 71, 72, 137, 82, + 86, 82, 18, 15, 40, 130, 131, 132, 133, 25, + 144, 159, 12, 88, 147, 7, 8, 9, 73, 0, + 243, 37, 38, 137, 140, 3, 139, 137, 176, 144, + 46, 47, 52, 221, 138, 107, 52, 195, 112, 103, + 111, 57, 42, 109, 114, 138, 113, 3, 66, 3, + 89, 7, 8, 9, 107, 188, 81, 129, 130, 95, + 137, 137, 101, 76, 80, 137, 144, 82, 107, 105, + 70, 3, 205, 145, 74, 137, 145, 70, 6, 43, + 119, 65, 121, 4, 123, 124, 3, 71, 72, 128, + 129, 130, 131, 132, 133, 3, 3, 89, 89, 138, + 65, 249, 250, 87, 88, 49, 71, 72, 143, 101, + 7, 8, 9, 110, 121, 107, 3, 86, 137, 81, + 202, 137, 87, 88, 63, 3, 87, 119, 133, 121, + 144, 123, 124, 89, 138, 144, 128, 129, 130, 131, + 132, 133, 10, 113, 118, 101, 138, 59, 138, 47, + 18, 107, 58, 221, 12, 228, 112, 25, 7, 8, + 9, 189, 30, 119, 53, 121, 112, 123, 124, 37, + 38, 97, 128, 129, 130, 131, 132, 133, 46, 47, + 8, 9, 79, 237, 52, 144, 119, 236, 205, 57, + 166, 104, 89, 236, 7, 8, 9, -1, -1, -1, + -1, -1, -1, -1, 101, 102, -1, 7, 8, 9, + 107, -1, 80, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 119, -1, 121, -1, 123, 124, -1, -1, + -1, 128, 129, 130, 131, 132, 133, -1, -1, -1, + 89, -1, -1, 7, 8, 9, -1, -1, -1, -1, + -1, -1, 101, -1, -1, -1, -1, -1, 107, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 137, + 119, -1, 121, -1, 123, 124, 89, -1, -1, 128, + 129, 130, 131, 132, 133, -1, -1, -1, 101, 89, + -1, -1, -1, -1, 107, 123, 124, -1, -1, -1, + 128, 129, 130, 131, 132, 133, -1, 107, 121, -1, + 123, 124, -1, -1, -1, 128, 129, 130, 131, 132, + 133, 121, -1, 123, 124, 89, -1, -1, 128, 129, + 130, 131, 132, 133, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 121, -1, 123, + 124, -1, -1, -1, 128, 129, 130, 131, 132, 133 +}; + + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 10, 18, 25, 30, 37, 38, 46, 47, 52, + 57, 80, 137, 147, 148, 149, 150, 151, 152, 153, + 156, 161, 162, 163, 164, 166, 169, 170, 171, 173, + 30, 3, 204, 3, 3, 73, 82, 82, 86, 15, + 174, 203, 204, 73, 170, 171, 0, 140, 211, 12, + 42, 70, 74, 172, 180, 3, 139, 137, 141, 142, + 114, 157, 204, 103, 154, 204, 3, 4, 5, 6, + 107, 129, 130, 137, 145, 175, 183, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 109, 204, 138, 138, 149, 113, 173, 66, 182, + 3, 184, 193, 150, 148, 107, 204, 76, 177, 81, + 137, 165, 137, 139, 186, 186, 186, 82, 176, 144, + 3, 7, 8, 9, 89, 101, 107, 112, 119, 121, + 123, 124, 128, 129, 130, 131, 132, 133, 205, 206, + 3, 167, 168, 186, 180, 196, 138, 144, 211, 43, + 82, 137, 186, 155, 194, 3, 212, 58, 171, 174, + 3, 138, 137, 199, 200, 202, 204, 207, 209, 177, + 185, 186, 186, 186, 186, 186, 89, 3, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 121, 144, + 177, 79, 102, 181, 182, 49, 193, 143, 110, 3, + 158, 159, 86, 138, 144, 137, 186, 169, 144, 206, + 65, 71, 72, 88, 208, 63, 178, 186, 193, 168, + 196, 81, 28, 40, 95, 105, 160, 138, 144, 204, + 3, 184, 138, 138, 200, 201, 87, 113, 155, 159, + 138, 205, 144, 137, 202, 209, 183, 200, 169, 118, + 45, 179, 138, 186, 210, 186, 205 +}; + + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 146, 147, 148, 148, 149, 149, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 151, 151, 152, 152, + 153, 154, 155, 156, 156, 157, 157, 158, 158, 159, + 160, 160, 160, 160, 161, 161, 162, 163, 164, 164, + 165, 165, 166, 167, 167, 168, 169, 169, 170, 170, + 171, 171, 172, 172, 172, 173, 174, 174, 175, 176, + 177, 177, 178, 178, 179, 179, 180, 180, 181, 181, + 181, 182, 182, 182, 183, 183, 184, 184, 185, 186, + 186, 186, 186, 186, 187, 187, 187, 188, 188, 189, + 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, + 190, 190, 190, 190, 190, 190, 191, 192, 192, 193, + 193, 193, 194, 195, 195, 196, 197, 198, 199, 199, + 200, 200, 200, 201, 201, 202, 203, 204, 204, 205, + 205, 206, 206, 207, 208, 208, 208, 208, 208, 209, + 209, 210, 211, 211, 212, 212 +}; + + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 2, 1, 3, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 4, 6, 2, 5, + 7, 1, 1, 8, 7, 3, 0, 1, 3, 2, + 1, 1, 1, 1, 3, 3, 4, 2, 8, 5, + 3, 0, 5, 1, 3, 3, 1, 1, 3, 3, + 3, 5, 1, 1, 1, 6, 1, 0, 1, 2, + 2, 0, 4, 0, 2, 0, 4, 0, 1, 1, + 0, 2, 4, 0, 1, 3, 1, 3, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, + 3, 3, 3, 3, 3, 3, 5, 1, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 1, 4, 1, 1, 3, 2, 1, 1, 3, 2, + 1, 1, 0, 6, 1, 1, 1, 1, 0, 4, + 1, 1, 1, 0, 1, 3 +}; + + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (&yylloc, result, scanner, YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (0) + +/* Error token number */ +#define YYTERROR 1 +#define YYERRCODE 256 + + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (0) +#endif + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) + + +/* Enable debugging if requested. */ +#if HSQL_DEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if defined HSQL_LTYPE_IS_TRIVIAL && HSQL_LTYPE_IS_TRIVIAL + +/* Print *YYLOCP on YYO. Private, do not rely on its existence. */ + +YY_ATTRIBUTE_UNUSED +static unsigned +yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += YYFPRINTF (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += YYFPRINTF (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += YYFPRINTF (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += YYFPRINTF (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += YYFPRINTF (yyo, "-%d", end_col); + } + return res; + } + +# define YY_LOCATION_PRINT(File, Loc) \ + yy_location_print_ (File, &(Loc)) + +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value, Location, result, scanner); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ + +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, hsql::SQLStatementList** result, yyscan_t scanner) +{ + FILE *yyo = yyoutput; + YYUSE (yyo); + YYUSE (yylocationp); + YYUSE (result); + YYUSE (scanner); + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# endif + YYUSE (yytype); +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, hsql::SQLStatementList** result, yyscan_t scanner) +{ + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); + + YY_LOCATION_PRINT (yyoutput, *yylocationp); + YYFPRINTF (yyoutput, ": "); + yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, result, scanner); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +static void +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +static void +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, hsql::SQLStatementList** result, yyscan_t scanner) +{ + unsigned long int yylno = yyrline[yyrule]; + int yynrhs = yyr2[yyrule]; + int yyi; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + , &(yylsp[(yyi + 1) - (yynrhs)]) , result, scanner); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, yylsp, Rule, result, scanner); \ +} while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !HSQL_DEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !HSQL_DEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +static YYSIZE_T +yystrlen (const char *yystr) +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +static char * +yystpcpy (char *yydest, const char *yysrc) +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. + + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + yytype_int16 *yyssp, int yytoken) +{ + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULLPTR; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; + + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) + { + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + { + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + } + } + } + + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } + + { + YYSIZE_T yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } + + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; + } + else + { + yyp++; + yyformat++; + } + } + return 0; +} +#endif /* YYERROR_VERBOSE */ + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, hsql::SQLStatementList** result, yyscan_t scanner) +{ + YYUSE (yyvaluep); + YYUSE (yylocationp); + YYUSE (result); + YYUSE (scanner); + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + + + +/*----------. +| yyparse. | +`----------*/ + +int +yyparse (hsql::SQLStatementList** result, yyscan_t scanner) +{ +/* The lookahead symbol. */ +int yychar; + + +/* The semantic value of the lookahead symbol. */ +/* Default value used for initialization, for pacifying older GCCs + or non-GCC compilers. */ +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); + +/* Location data for the lookahead symbol. */ +static YYLTYPE yyloc_default +# if defined HSQL_LTYPE_IS_TRIVIAL && HSQL_LTYPE_IS_TRIVIAL + = { 1, 1, 1, 1 } +# endif +; +YYLTYPE yylloc = yyloc_default; + + /* Number of syntax errors so far. */ + int yynerrs; + + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + + /* The stacks and their tools: + 'yyss': related to states. + 'yyvs': related to semantic values. + 'yyls': related to locations. + + Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + /* The location stack. */ + YYLTYPE yylsa[YYINITDEPTH]; + YYLTYPE *yyls; + YYLTYPE *yylsp; + + /* The locations where the error started and ended. */ + YYLTYPE yyerror_range[3]; + + YYSIZE_T yystacksize; + + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken = 0; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + YYLTYPE yyloc; + +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; + yylsp = yyls = yylsa; + yystacksize = YYINITDEPTH; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + +/* User initialization code. */ +#line 77 "bison_parser.y" /* yacc.c:1429 */ +{ + // Initialize + yylloc.first_column = 0; + yylloc.last_column = 0; + yylloc.first_line = 0; + yylloc.last_line = 0; + yylloc.total_column = 0; + yylloc.placeholder_id = 0; +} + +#line 1644 "bison_parser.cpp" /* yacc.c:1429 */ + yylsp[0] = yylloc; + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + YYLTYPE *yyls1 = yyls; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yyls1, yysize * sizeof (*yylsp), + &yystacksize); + + yyls = yyls1; + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); + YYSTACK_RELOCATE (yyls_alloc, yyls); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + yylsp = yyls + yysize - 1; + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yypact_value_is_default (yyn)) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = yylex (&yylval, &yylloc, scanner); + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yytable_value_is_error (yyn)) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token. */ + yychar = YYEMPTY; + + yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + *++yylsp = yylloc; + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + '$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + /* Default location. */ + YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 2: +#line 227 "bison_parser.y" /* yacc.c:1646 */ + { + *result = (yyvsp[-1].stmt_list); + } +#line 1835 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 3: +#line 234 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.stmt_list) = new SQLStatementList((yyvsp[0].statement)); } +#line 1841 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 4: +#line 235 "bison_parser.y" /* yacc.c:1646 */ + { (yyvsp[-2].stmt_list)->addStatement((yyvsp[0].statement)); (yyval.stmt_list) = (yyvsp[-2].stmt_list); } +#line 1847 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 5: +#line 239 "bison_parser.y" /* yacc.c:1646 */ + { + (yyvsp[0].prep_stmt)->setPlaceholders(yyloc.placeholder_list); + yyloc.placeholder_list.clear(); + (yyval.statement) = (yyvsp[0].prep_stmt); + } +#line 1857 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 7: +#line 249 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.statement) = (yyvsp[0].select_stmt); } +#line 1863 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 8: +#line 250 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.statement) = (yyvsp[0].import_stmt); } +#line 1869 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 9: +#line 251 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.statement) = (yyvsp[0].create_stmt); } +#line 1875 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 10: +#line 252 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.statement) = (yyvsp[0].insert_stmt); } +#line 1881 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 11: +#line 253 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.statement) = (yyvsp[0].delete_stmt); } +#line 1887 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 12: +#line 254 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.statement) = (yyvsp[0].delete_stmt); } +#line 1893 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 13: +#line 255 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.statement) = (yyvsp[0].update_stmt); } +#line 1899 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 14: +#line 256 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.statement) = (yyvsp[0].drop_stmt); } +#line 1905 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 15: +#line 257 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.statement) = (yyvsp[0].exec_stmt); } +#line 1911 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 16: +#line 265 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.prep_stmt) = new PrepareStatement(); + (yyval.prep_stmt)->name = (yyvsp[-2].sval); + (yyval.prep_stmt)->query = new SQLStatementList((yyvsp[0].statement)); + } +#line 1921 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 17: +#line 270 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.prep_stmt) = new PrepareStatement(); + (yyval.prep_stmt)->name = (yyvsp[-4].sval); + (yyval.prep_stmt)->query = (yyvsp[-2].stmt_list); + } +#line 1931 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 18: +#line 278 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.exec_stmt) = new ExecuteStatement(); + (yyval.exec_stmt)->name = (yyvsp[0].sval); + } +#line 1940 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 19: +#line 282 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.exec_stmt) = new ExecuteStatement(); + (yyval.exec_stmt)->name = (yyvsp[-3].sval); + (yyval.exec_stmt)->parameters = (yyvsp[-1].expr_vec); + } +#line 1950 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 20: +#line 294 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.import_stmt) = new ImportStatement((ImportStatement::ImportType) (yyvsp[-4].uval)); + (yyval.import_stmt)->file_path = (yyvsp[-2].sval); + (yyval.import_stmt)->table_name = (yyvsp[0].sval); + } +#line 1960 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 21: +#line 302 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = ImportStatement::kImportCSV; } +#line 1966 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 22: +#line 306 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.sval) = (yyvsp[0].expr)->name; } +#line 1972 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 23: +#line 316 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.create_stmt) = new CreateStatement(CreateStatement::kTableFromTbl); + (yyval.create_stmt)->if_not_exists = (yyvsp[-5].bval); + (yyval.create_stmt)->table_name = (yyvsp[-4].sval); + (yyval.create_stmt)->file_path = (yyvsp[0].sval); + } +#line 1983 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 24: +#line 322 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.create_stmt) = new CreateStatement(CreateStatement::kTable); + (yyval.create_stmt)->if_not_exists = (yyvsp[-4].bval); + (yyval.create_stmt)->table_name = (yyvsp[-3].sval); + (yyval.create_stmt)->columns = (yyvsp[-1].column_vec); + } +#line 1994 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 25: +#line 331 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.bval) = true; } +#line 2000 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 26: +#line 332 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.bval) = false; } +#line 2006 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 27: +#line 336 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.column_vec) = new std::vector(); (yyval.column_vec)->push_back((yyvsp[0].column_t)); } +#line 2012 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 28: +#line 337 "bison_parser.y" /* yacc.c:1646 */ + { (yyvsp[-2].column_vec)->push_back((yyvsp[0].column_t)); (yyval.column_vec) = (yyvsp[-2].column_vec); } +#line 2018 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 29: +#line 341 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.column_t) = new ColumnDefinition((yyvsp[-1].sval), (ColumnDefinition::DataType) (yyvsp[0].uval)); + } +#line 2026 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 30: +#line 348 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = ColumnDefinition::INT; } +#line 2032 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 31: +#line 349 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = ColumnDefinition::INT; } +#line 2038 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 32: +#line 350 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = ColumnDefinition::DOUBLE; } +#line 2044 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 33: +#line 351 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = ColumnDefinition::TEXT; } +#line 2050 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 34: +#line 361 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.drop_stmt) = new DropStatement(DropStatement::kTable); + (yyval.drop_stmt)->name = (yyvsp[0].sval); + } +#line 2059 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 35: +#line 365 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.drop_stmt) = new DropStatement(DropStatement::kPreparedStatement); + (yyval.drop_stmt)->name = (yyvsp[0].sval); + } +#line 2068 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 36: +#line 377 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.delete_stmt) = new DeleteStatement(); + (yyval.delete_stmt)->table_name = (yyvsp[-1].sval); + (yyval.delete_stmt)->expr = (yyvsp[0].expr); + } +#line 2078 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 37: +#line 385 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.delete_stmt) = new DeleteStatement(); + (yyval.delete_stmt)->table_name = (yyvsp[0].sval); + } +#line 2087 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 38: +#line 397 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.insert_stmt) = new InsertStatement(InsertStatement::kInsertValues); + (yyval.insert_stmt)->table_name = (yyvsp[-5].sval); + (yyval.insert_stmt)->columns = (yyvsp[-4].str_vec); + (yyval.insert_stmt)->values = (yyvsp[-1].expr_vec); + } +#line 2098 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 39: +#line 403 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.insert_stmt) = new InsertStatement(InsertStatement::kInsertSelect); + (yyval.insert_stmt)->table_name = (yyvsp[-2].sval); + (yyval.insert_stmt)->columns = (yyvsp[-1].str_vec); + (yyval.insert_stmt)->select = (yyvsp[0].select_stmt); + } +#line 2109 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 40: +#line 413 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.str_vec) = (yyvsp[-1].str_vec); } +#line 2115 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 41: +#line 414 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.str_vec) = NULL; } +#line 2121 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 42: +#line 424 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.update_stmt) = new UpdateStatement(); + (yyval.update_stmt)->table = (yyvsp[-3].table); + (yyval.update_stmt)->updates = (yyvsp[-1].update_vec); + (yyval.update_stmt)->where = (yyvsp[0].expr); + } +#line 2132 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 43: +#line 433 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.update_vec) = new std::vector(); (yyval.update_vec)->push_back((yyvsp[0].update_t)); } +#line 2138 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 44: +#line 434 "bison_parser.y" /* yacc.c:1646 */ + { (yyvsp[-2].update_vec)->push_back((yyvsp[0].update_t)); (yyval.update_vec) = (yyvsp[-2].update_vec); } +#line 2144 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 45: +#line 438 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.update_t) = new UpdateClause(); + (yyval.update_t)->column = (yyvsp[-2].sval); + (yyval.update_t)->value = (yyvsp[0].expr); + } +#line 2154 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 48: +#line 455 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } +#line 2160 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 49: +#line 456 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } +#line 2166 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 50: +#line 460 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.select_stmt) = (yyvsp[-2].select_stmt); + (yyval.select_stmt)->order = (yyvsp[-1].order); + (yyval.select_stmt)->limit = (yyvsp[0].limit); + } +#line 2176 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 51: +#line 465 "bison_parser.y" /* yacc.c:1646 */ + { + // TODO: allow multiple unions (through linked list) + // TODO: capture type of set_operator + // TODO: might overwrite order and limit of first select here + (yyval.select_stmt) = (yyvsp[-4].select_stmt); + (yyval.select_stmt)->union_select = (yyvsp[-2].select_stmt); + (yyval.select_stmt)->order = (yyvsp[-1].order); + (yyval.select_stmt)->limit = (yyvsp[0].limit); + } +#line 2190 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 55: +#line 483 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.select_stmt) = new SelectStatement(); + (yyval.select_stmt)->select_distinct = (yyvsp[-4].bval); + (yyval.select_stmt)->select_list = (yyvsp[-3].expr_vec); + (yyval.select_stmt)->from_table = (yyvsp[-2].table); + (yyval.select_stmt)->where_clause = (yyvsp[-1].expr); + (yyval.select_stmt)->group_by = (yyvsp[0].group_t); + } +#line 2203 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 56: +#line 494 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.bval) = true; } +#line 2209 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 57: +#line 495 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.bval) = false; } +#line 2215 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 59: +#line 504 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.table) = (yyvsp[0].table); } +#line 2221 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 60: +#line 509 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = (yyvsp[0].expr); } +#line 2227 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 61: +#line 510 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = NULL; } +#line 2233 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 62: +#line 514 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.group_t) = new GroupByDescription(); + (yyval.group_t)->columns = (yyvsp[-1].expr_vec); + (yyval.group_t)->having = (yyvsp[0].expr); + } +#line 2243 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 63: +#line 519 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.group_t) = NULL; } +#line 2249 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 64: +#line 523 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = (yyvsp[0].expr); } +#line 2255 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 65: +#line 524 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = NULL; } +#line 2261 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 66: +#line 527 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.order) = new OrderDescription((yyvsp[0].order_type), (yyvsp[-1].expr)); } +#line 2267 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 67: +#line 528 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.order) = NULL; } +#line 2273 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 68: +#line 532 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.order_type) = kOrderAsc; } +#line 2279 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 69: +#line 533 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.order_type) = kOrderDesc; } +#line 2285 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 70: +#line 534 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.order_type) = kOrderAsc; } +#line 2291 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 71: +#line 539 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.limit) = new LimitDescription((yyvsp[0].expr)->ival, kNoOffset); delete (yyvsp[0].expr); } +#line 2297 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 72: +#line 540 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.limit) = new LimitDescription((yyvsp[-2].expr)->ival, (yyvsp[0].expr)->ival); delete (yyvsp[-2].expr); delete (yyvsp[0].expr); } +#line 2303 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 73: +#line 541 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.limit) = NULL; } +#line 2309 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 74: +#line 548 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } +#line 2315 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 75: +#line 549 "bison_parser.y" /* yacc.c:1646 */ + { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } +#line 2321 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 76: +#line 553 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } +#line 2327 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 77: +#line 554 "bison_parser.y" /* yacc.c:1646 */ + { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } +#line 2333 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 78: +#line 558 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.expr) = (yyvsp[-1].expr); + (yyval.expr)->alias = (yyvsp[0].sval); + } +#line 2342 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 79: +#line 565 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = (yyvsp[-1].expr); } +#line 2348 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 87: +#line 579 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpUnary(Expr::UMINUS, (yyvsp[0].expr)); } +#line 2354 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 88: +#line 580 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpUnary(Expr::NOT, (yyvsp[0].expr)); } +#line 2360 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 90: +#line 585 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), '-', (yyvsp[0].expr)); } +#line 2366 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 91: +#line 586 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), '+', (yyvsp[0].expr)); } +#line 2372 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 92: +#line 587 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), '/', (yyvsp[0].expr)); } +#line 2378 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 93: +#line 588 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), '*', (yyvsp[0].expr)); } +#line 2384 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 94: +#line 589 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), '%', (yyvsp[0].expr)); } +#line 2390 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 95: +#line 590 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), '^', (yyvsp[0].expr)); } +#line 2396 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 96: +#line 591 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), Expr::AND, (yyvsp[0].expr)); } +#line 2402 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 97: +#line 592 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), Expr::OR, (yyvsp[0].expr)); } +#line 2408 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 98: +#line 593 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), Expr::LIKE, (yyvsp[0].expr)); } +#line 2414 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 99: +#line 594 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-3].expr), Expr::NOT_LIKE, (yyvsp[0].expr)); } +#line 2420 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 100: +#line 599 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), '=', (yyvsp[0].expr)); } +#line 2426 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 101: +#line 600 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), Expr::NOT_EQUALS, (yyvsp[0].expr)); } +#line 2432 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 102: +#line 601 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), '<', (yyvsp[0].expr)); } +#line 2438 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 103: +#line 602 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), '>', (yyvsp[0].expr)); } +#line 2444 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 104: +#line 603 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), Expr::LESS_EQ, (yyvsp[0].expr)); } +#line 2450 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 105: +#line 604 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), Expr::GREATER_EQ, (yyvsp[0].expr)); } +#line 2456 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 106: +#line 608 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-4].sval), (yyvsp[-1].expr), (yyvsp[-2].bval)); } +#line 2462 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 107: +#line 612 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeColumnRef((yyvsp[0].sval)); } +#line 2468 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 108: +#line 613 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeColumnRef((yyvsp[-2].sval), (yyvsp[0].sval)); } +#line 2474 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 112: +#line 623 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeLiteral((yyvsp[0].sval)); } +#line 2480 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 113: +#line 628 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeLiteral((yyvsp[0].fval)); } +#line 2486 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 115: +#line 633 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeLiteral((yyvsp[0].ival)); } +#line 2492 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 116: +#line 637 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = new Expr(kExprStar); } +#line 2498 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 117: +#line 642 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.expr) = Expr::makePlaceholder(yylloc.total_column); + yyloc.placeholder_list.push_back((yyval.expr)); + } +#line 2507 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 119: +#line 654 "bison_parser.y" /* yacc.c:1646 */ + { + (yyvsp[0].table_vec)->push_back((yyvsp[-2].table)); + auto tbl = new TableRef(kTableCrossProduct); + tbl->list = (yyvsp[0].table_vec); + (yyval.table) = tbl; + } +#line 2518 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 121: +#line 665 "bison_parser.y" /* yacc.c:1646 */ + { + auto tbl = new TableRef(kTableSelect); + tbl->select = (yyvsp[-2].select_stmt); + tbl->alias = (yyvsp[0].sval); + (yyval.table) = tbl; + } +#line 2529 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 123: +#line 676 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.table_vec) = new std::vector(); (yyval.table_vec)->push_back((yyvsp[0].table)); } +#line 2535 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 124: +#line 677 "bison_parser.y" /* yacc.c:1646 */ + { (yyvsp[-2].table_vec)->push_back((yyvsp[0].table)); (yyval.table_vec) = (yyvsp[-2].table_vec); } +#line 2541 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 125: +#line 682 "bison_parser.y" /* yacc.c:1646 */ + { + auto tbl = new TableRef(kTableName); + tbl->name = (yyvsp[-1].sval); + tbl->alias = (yyvsp[0].sval); + (yyval.table) = tbl; + } +#line 2552 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 126: +#line 692 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.table) = new TableRef(kTableName); + (yyval.table)->name = (yyvsp[0].sval); + } +#line 2561 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 129: +#line 706 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.sval) = (yyvsp[0].sval); } +#line 2567 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 132: +#line 712 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.sval) = NULL; } +#line 2573 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 133: +#line 721 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.table) = new TableRef(kTableJoin); + (yyval.table)->join = new JoinDefinition(); + (yyval.table)->join->type = (JoinType) (yyvsp[-4].uval); + (yyval.table)->join->left = (yyvsp[-5].table); + (yyval.table)->join->right = (yyvsp[-2].table); + (yyval.table)->join->condition = (yyvsp[0].expr); + } +#line 2586 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 134: +#line 732 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinInner; } +#line 2592 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 135: +#line 733 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinOuter; } +#line 2598 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 136: +#line 734 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinLeft; } +#line 2604 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 137: +#line 735 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinRight; } +#line 2610 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 138: +#line 736 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinInner; } +#line 2616 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 139: +#line 742 "bison_parser.y" /* yacc.c:1646 */ + { + auto tbl = new TableRef(kTableSelect); + tbl->select = (yyvsp[-2].select_stmt); + tbl->alias = (yyvsp[0].sval); + (yyval.table) = tbl; + } +#line 2627 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 144: +#line 767 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.str_vec) = new std::vector(); (yyval.str_vec)->push_back((yyvsp[0].sval)); } +#line 2633 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 145: +#line 768 "bison_parser.y" /* yacc.c:1646 */ + { (yyvsp[-2].str_vec)->push_back((yyvsp[0].sval)); (yyval.str_vec) = (yyvsp[-2].str_vec); } +#line 2639 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + +#line 2643 "bison_parser.cpp" /* yacc.c:1646 */ + default: break; + } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + *++yylsp = yyloc; + + /* Now 'shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ +yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (&yylloc, result, scanner, YY_("syntax error")); +#else +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ + yyssp, yytoken) + { + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = YYSYNTAX_ERROR; + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); + if (!yymsg) + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + yyerror (&yylloc, result, scanner, yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; + } +# undef YYSYNTAX_ERROR +#endif + } + + yyerror_range[1] = yylloc; + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval, &yylloc, result, scanner); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + yyerror_range[1] = yylsp[1-yylen]; + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (!yypact_value_is_default (yyn)) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + yyerror_range[1] = *yylsp; + yydestruct ("Error: popping", + yystos[yystate], yyvsp, yylsp, result, scanner); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + yyerror_range[2] = yylloc; + /* Using YYLLOC is tempting, but would change the location of + the lookahead. YYLOC is available though. */ + YYLLOC_DEFAULT (yyloc, yyerror_range, 2); + *++yylsp = yyloc; + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#if !defined yyoverflow || YYERROR_VERBOSE +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (&yylloc, result, scanner, YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEMPTY) + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, &yylloc, result, scanner); + } + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp, yylsp, result, scanner); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + return yyresult; +} +#line 771 "bison_parser.y" /* yacc.c:1906 */ + +/********************************* + ** Section 4: Additional C code + *********************************/ + +/* empty */ + diff --git a/src/parser/bison_parser.h b/src/parser/bison_parser.h new file mode 100644 index 0000000..21a9415 --- /dev/null +++ b/src/parser/bison_parser.h @@ -0,0 +1,269 @@ +/* A Bison parser, made by GNU Bison 3.0.2. */ + +/* Bison interface for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +#ifndef YY_HSQL_BISON_PARSER_H_INCLUDED +# define YY_HSQL_BISON_PARSER_H_INCLUDED +/* Debug traces. */ +#ifndef HSQL_DEBUG +# if defined YYDEBUG +#if YYDEBUG +# define HSQL_DEBUG 1 +# else +# define HSQL_DEBUG 0 +# endif +# else /* ! defined YYDEBUG */ +# define HSQL_DEBUG 0 +# endif /* ! defined YYDEBUG */ +#endif /* ! defined HSQL_DEBUG */ +#if HSQL_DEBUG +extern int hsql_debug; +#endif +/* "%code requires" blocks. */ +#line 43 "bison_parser.y" /* yacc.c:1909 */ + +// %code requires block +#include "parser_typedef.h" + +// Auto update column and line number +#define YY_USER_ACTION \ + yylloc->first_line = yylloc->last_line; \ + yylloc->first_column = yylloc->last_column; \ + for(int i = 0; yytext[i] != '\0'; i++) { \ + yylloc->total_column++; \ + if(yytext[i] == '\n') { \ + yylloc->last_line++; \ + yylloc->last_column = 0; \ + } \ + else { \ + yylloc->last_column++; \ + } \ + } + +#line 72 "bison_parser.h" /* yacc.c:1909 */ + +/* Token type. */ +#ifndef HSQL_TOKENTYPE +# define HSQL_TOKENTYPE + enum hsql_tokentype + { + SQL_IDENTIFIER = 258, + SQL_STRING = 259, + SQL_FLOATVAL = 260, + SQL_INTVAL = 261, + SQL_NOTEQUALS = 262, + SQL_LESSEQ = 263, + SQL_GREATEREQ = 264, + SQL_DEALLOCATE = 265, + SQL_PARAMETERS = 266, + SQL_INTERSECT = 267, + SQL_TEMPORARY = 268, + SQL_TIMESTAMP = 269, + SQL_DISTINCT = 270, + SQL_NVARCHAR = 271, + SQL_RESTRICT = 272, + SQL_TRUNCATE = 273, + SQL_ANALYZE = 274, + SQL_BETWEEN = 275, + SQL_CASCADE = 276, + SQL_COLUMNS = 277, + SQL_CONTROL = 278, + SQL_DEFAULT = 279, + SQL_EXECUTE = 280, + SQL_EXPLAIN = 281, + SQL_HISTORY = 282, + SQL_INTEGER = 283, + SQL_NATURAL = 284, + SQL_PREPARE = 285, + SQL_PRIMARY = 286, + SQL_SCHEMAS = 287, + SQL_SPATIAL = 288, + SQL_VIRTUAL = 289, + SQL_BEFORE = 290, + SQL_COLUMN = 291, + SQL_CREATE = 292, + SQL_DELETE = 293, + SQL_DIRECT = 294, + SQL_DOUBLE = 295, + SQL_ESCAPE = 296, + SQL_EXCEPT = 297, + SQL_EXISTS = 298, + SQL_GLOBAL = 299, + SQL_HAVING = 300, + SQL_IMPORT = 301, + SQL_INSERT = 302, + SQL_ISNULL = 303, + SQL_OFFSET = 304, + SQL_RENAME = 305, + SQL_SCHEMA = 306, + SQL_SELECT = 307, + SQL_SORTED = 308, + SQL_TABLES = 309, + SQL_UNIQUE = 310, + SQL_UNLOAD = 311, + SQL_UPDATE = 312, + SQL_VALUES = 313, + SQL_AFTER = 314, + SQL_ALTER = 315, + SQL_CROSS = 316, + SQL_DELTA = 317, + SQL_GROUP = 318, + SQL_INDEX = 319, + SQL_INNER = 320, + SQL_LIMIT = 321, + SQL_LOCAL = 322, + SQL_MERGE = 323, + SQL_MINUS = 324, + SQL_ORDER = 325, + SQL_OUTER = 326, + SQL_RIGHT = 327, + SQL_TABLE = 328, + SQL_UNION = 329, + SQL_USING = 330, + SQL_WHERE = 331, + SQL_CALL = 332, + SQL_DATE = 333, + SQL_DESC = 334, + SQL_DROP = 335, + SQL_FILE = 336, + SQL_FROM = 337, + SQL_FULL = 338, + SQL_HASH = 339, + SQL_HINT = 340, + SQL_INTO = 341, + SQL_JOIN = 342, + SQL_LEFT = 343, + SQL_LIKE = 344, + SQL_LOAD = 345, + SQL_NULL = 346, + SQL_PART = 347, + SQL_PLAN = 348, + SQL_SHOW = 349, + SQL_TEXT = 350, + SQL_TIME = 351, + SQL_VIEW = 352, + SQL_WITH = 353, + SQL_ADD = 354, + SQL_ALL = 355, + SQL_AND = 356, + SQL_ASC = 357, + SQL_CSV = 358, + SQL_FOR = 359, + SQL_INT = 360, + SQL_KEY = 361, + SQL_NOT = 362, + SQL_OFF = 363, + SQL_SET = 364, + SQL_TBL = 365, + SQL_TOP = 366, + SQL_AS = 367, + SQL_BY = 368, + SQL_IF = 369, + SQL_IN = 370, + SQL_IS = 371, + SQL_OF = 372, + SQL_ON = 373, + SQL_OR = 374, + SQL_TO = 375, + SQL_EQUALS = 376, + SQL_LESS = 377, + SQL_GREATER = 378, + SQL_NOTNULL = 379, + SQL_UMINUS = 380 + }; +#endif + +/* Value type. */ +#if ! defined HSQL_STYPE && ! defined HSQL_STYPE_IS_DECLARED +typedef union HSQL_STYPE HSQL_STYPE; +union HSQL_STYPE +{ +#line 99 "bison_parser.y" /* yacc.c:1909 */ + + double fval; + int64_t ival; + char* sval; + uint uval; + bool bval; + + hsql::SQLStatement* statement; + hsql::SelectStatement* select_stmt; + hsql::ImportStatement* import_stmt; + hsql::CreateStatement* create_stmt; + hsql::InsertStatement* insert_stmt; + hsql::DeleteStatement* delete_stmt; + hsql::UpdateStatement* update_stmt; + hsql::DropStatement* drop_stmt; + hsql::PrepareStatement* prep_stmt; + hsql::ExecuteStatement* exec_stmt; + + hsql::TableRef* table; + hsql::Expr* expr; + hsql::OrderDescription* order; + hsql::OrderType order_type; + hsql::LimitDescription* limit; + hsql::ColumnDefinition* column_t; + hsql::GroupByDescription* group_t; + hsql::UpdateClause* update_t; + + hsql::SQLStatementList* stmt_list; + + std::vector* str_vec; + std::vector* table_vec; + std::vector* column_vec; + std::vector* update_vec; + std::vector* expr_vec; + +#line 246 "bison_parser.h" /* yacc.c:1909 */ +}; +# define HSQL_STYPE_IS_TRIVIAL 1 +# define HSQL_STYPE_IS_DECLARED 1 +#endif + +/* Location type. */ +#if ! defined HSQL_LTYPE && ! defined HSQL_LTYPE_IS_DECLARED +typedef struct HSQL_LTYPE HSQL_LTYPE; +struct HSQL_LTYPE +{ + int first_line; + int first_column; + int last_line; + int last_column; +}; +# define HSQL_LTYPE_IS_DECLARED 1 +# define HSQL_LTYPE_IS_TRIVIAL 1 +#endif + + + +int hsql_parse (hsql::SQLStatementList** result, yyscan_t scanner); + +#endif /* !YY_HSQL_BISON_PARSER_H_INCLUDED */ diff --git a/src/parser/flex_lexer.cpp b/src/parser/flex_lexer.cpp new file mode 100644 index 0000000..ae00970 --- /dev/null +++ b/src/parser/flex_lexer.cpp @@ -0,0 +1,3696 @@ +#line 2 "flex_lexer.cpp" + +#line 4 "flex_lexer.cpp" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 35 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yyg->yy_start = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yyg->yy_start - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE hsql_restart(yyin ,yyscanner ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = yyg->yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via hsql_restart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ + ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ + : NULL) + +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] + +void hsql_restart (FILE *input_file ,yyscan_t yyscanner ); +void hsql__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); +YY_BUFFER_STATE hsql__create_buffer (FILE *file,int size ,yyscan_t yyscanner ); +void hsql__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); +void hsql__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); +void hsql_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); +void hsql_pop_buffer_state (yyscan_t yyscanner ); + +static void hsql_ensure_buffer_stack (yyscan_t yyscanner ); +static void hsql__load_buffer_state (yyscan_t yyscanner ); +static void hsql__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); + +#define YY_FLUSH_BUFFER hsql__flush_buffer(YY_CURRENT_BUFFER ,yyscanner) + +YY_BUFFER_STATE hsql__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); +YY_BUFFER_STATE hsql__scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); +YY_BUFFER_STATE hsql__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); + +void *hsql_alloc (yy_size_t ,yyscan_t yyscanner ); +void *hsql_realloc (void *,yy_size_t ,yyscan_t yyscanner ); +void hsql_free (void * ,yyscan_t yyscanner ); + +#define yy_new_buffer hsql__create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + hsql_ensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + hsql__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + hsql_ensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + hsql__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +#define hsql_wrap(n) 1 +#define YY_SKIP_YYWRAP + +typedef unsigned char YY_CHAR; + +typedef int yy_state_type; + +#define yytext_ptr yytext_r + +static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); +static int yy_get_next_buffer (yyscan_t yyscanner ); +static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yyg->yytext_ptr = yy_bp; \ + yyleng = (size_t) (yy_cp - yy_bp); \ + yyg->yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yyg->yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 127 +#define YY_END_OF_BUFFER 128 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_accept[894] = + { 0, + 0, 0, 2, 2, 128, 126, 4, 4, 126, 119, + 126, 119, 119, 122, 119, 119, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 2, + 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 4, 0, 0, 125, 1, 121, 120, + 122, 117, 116, 118, 124, 124, 124, 124, 124, 107, + 124, 108, 124, 124, 124, 124, 124, 124, 124, 124, + + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 109, 124, 110, 111, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 112, 113, 114, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 115, 124, 124, 124, 124, 124, + 124, 124, 124, 2, 2, 2, 2, 2, 1, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 123, 120, 94, 124, 95, 124, + 124, 96, 97, 124, 124, 124, 124, 124, 124, 124, + 124, 98, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 99, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 100, 124, 124, 101, 124, 124, 124, 124, 124, 124, + 124, 124, 102, 124, 124, 103, 124, 124, 124, 124, + + 124, 124, 124, 124, 124, 124, 124, 104, 124, 124, + 124, 124, 105, 124, 124, 124, 106, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 124, 124, 124, 124, 124, 72, 124, 124, 124, 124, + 124, 73, 124, 124, 124, 124, 74, 124, 124, 124, + 75, 124, 124, 124, 124, 124, 76, 77, 78, 124, + 124, 79, 124, 80, 124, 124, 124, 124, 124, 124, + 81, 124, 82, 83, 84, 124, 85, 124, 124, 124, + 124, 86, 124, 124, 124, 124, 124, 87, 88, 124, + 124, 124, 124, 124, 124, 124, 89, 124, 124, 124, + 124, 90, 91, 124, 124, 124, 124, 124, 124, 124, + + 92, 124, 124, 93, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 54, 55, + 124, 124, 124, 124, 124, 124, 124, 56, 124, 124, + + 124, 57, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 58, 124, 124, 124, 59, 60, 124, 124, 124, + 124, 61, 62, 63, 64, 124, 124, 124, 65, 66, + 124, 124, 124, 124, 124, 67, 124, 124, 124, 124, + 68, 124, 124, 124, 69, 124, 124, 124, 70, 124, + 124, 71, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 124, 30, 124, 124, + 31, 124, 32, 124, 124, 33, 34, 124, 35, 36, + 37, 124, 38, 124, 39, 40, 124, 41, 42, 124, + 124, 43, 124, 124, 44, 124, 124, 124, 45, 124, + 46, 47, 48, 124, 49, 124, 124, 124, 50, 51, + 52, 53, 124, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 14, 15, 16, 17, 18, 124, 19, 124, 20, 21, + 22, 23, 124, 24, 124, 124, 25, 26, 124, 27, + 28, 124, 124, 124, 29, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 124, 10, 124, 11, 124, 12, 124, 124, 13, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 124, 7, + 124, 8, 9, 2, 2, 2, 2, 2, 5, 6, + 2, 2, 0 + + } ; + +static yyconst flex_int32_t yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 4, 1, 1, 5, 1, 6, 5, + 5, 5, 5, 5, 7, 8, 5, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 5, 5, 10, + 11, 12, 5, 1, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 1, 1, 1, 5, 39, 1, 40, 41, 42, 43, + + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 5, 1, 5, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst flex_int32_t yy_meta[66] = + { 0, + 1, 1, 2, 3, 1, 1, 1, 1, 4, 1, + 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4 + } ; + +static yyconst flex_int16_t yy_base[901] = + { 0, + 0, 0, 65, 0, 400, 3573, 129, 131, 0, 3573, + 392, 390, 355, 127, 126, 348, 123, 123, 131, 177, + 112, 170, 121, 129, 183, 119, 135, 138, 136, 186, + 219, 182, 0, 194, 265, 308, 228, 230, 240, 0, + 161, 255, 347, 0, 344, 340, 337, 254, 254, 334, + 365, 423, 475, 527, 260, 575, 362, 293, 623, 299, + 231, 357, 415, 675, 723, 775, 343, 420, 825, 877, + 925, 425, 433, 271, 335, 325, 3573, 3573, 299, 291, + 281, 3573, 3573, 3573, 0, 140, 164, 281, 189, 229, + 283, 0, 303, 364, 341, 233, 252, 477, 414, 284, + + 328, 378, 479, 388, 392, 420, 424, 424, 428, 452, + 467, 0, 430, 510, 450, 470, 467, 493, 520, 534, + 494, 520, 518, 520, 531, 543, 540, 0, 543, 528, + 531, 549, 573, 567, 561, 575, 577, 570, 569, 587, + 589, 580, 609, 581, 582, 578, 622, 599, 623, 623, + 633, 634, 620, 0, 296, 265, 249, 0, 0, 244, + 241, 294, 0, 0, 0, 647, 679, 666, 669, 721, + 729, 737, 663, 753, 783, 804, 687, 791, 977, 807, + 742, 829, 844, 1027, 858, 875, 879, 903, 911, 933, + 927, 967, 893, 975, 1076, 979, 965, 935, 989, 1033, + + 1023, 1042, 1072, 1073, 1086, 1037, 1087, 1077, 1109, 1122, + 1111, 1127, 1139, 1137, 1151, 1143, 1173, 1181, 1175, 1191, + 1209, 1197, 1199, 1234, 1235, 1230, 1247, 1245, 1284, 1271, + 1266, 1288, 1258, 1297, 3573, 207, 0, 638, 0, 641, + 638, 0, 0, 672, 670, 694, 747, 758, 763, 785, + 772, 0, 799, 809, 836, 867, 855, 857, 904, 932, + 921, 987, 993, 1003, 993, 1022, 1032, 0, 1032, 1091, + 1153, 1136, 1152, 1176, 1168, 1174, 1203, 1237, 1260, 1289, + 1296, 1279, 1290, 0, 1288, 1307, 1305, 1315, 1323, 1318, + 1305, 1309, 0, 1320, 1316, 1318, 1337, 1338, 1346, 1331, + + 1332, 1337, 1353, 1335, 1348, 1353, 1355, 0, 1339, 1343, + 1345, 1355, 0, 1352, 1351, 1368, 0, 1362, 1363, 1364, + 1383, 1372, 1367, 1368, 1376, 1379, 1391, 0, 201, 1396, + 1397, 1405, 1407, 1415, 1409, 1411, 1420, 1428, 1459, 1463, + 1460, 1450, 1478, 1482, 1464, 1494, 1508, 1499, 1512, 1518, + 1504, 1533, 1520, 1550, 1556, 1537, 1571, 1558, 1566, 1562, + 1574, 1587, 1604, 1615, 1590, 1616, 1625, 1640, 1644, 1648, + 1627, 1630, 1649, 1670, 1673, 1679, 1678, 1694, 1681, 1718, + 1684, 1723, 1727, 1724, 1732, 1733, 1735, 1763, 1758, 1737, + 1761, 1777, 1786, 1787, 1801, 1815, 1812, 1817, 1796, 1826, + + 1829, 1840, 1830, 1851, 1861, 1855, 1863, 1869, 1879, 1880, + 1894, 1905, 1909, 1928, 1913, 1918, 1939, 1943, 1954, 1968, + 1386, 1399, 1394, 1432, 1536, 0, 1585, 1618, 1652, 1688, + 1698, 0, 1759, 1775, 1850, 1874, 0, 1906, 1916, 1916, + 0, 1924, 1926, 1937, 1954, 1976, 0, 0, 0, 1977, + 1965, 0, 1968, 0, 1968, 1966, 1963, 1970, 1974, 1989, + 0, 1982, 0, 0, 0, 1977, 0, 1986, 1997, 1993, + 1995, 0, 2013, 2012, 2000, 2004, 2013, 0, 0, 2026, + 2027, 2017, 2013, 2012, 2020, 2032, 0, 2031, 2028, 2033, + 2026, 0, 2023, 2043, 2033, 2027, 2049, 2031, 2045, 2051, + + 0, 2040, 2061, 0, 2062, 2066, 2065, 2067, 2071, 2076, + 2081, 2097, 2116, 2095, 2111, 2099, 2120, 2133, 2130, 2139, + 2121, 2171, 2161, 2175, 2170, 2173, 2174, 2183, 2204, 2227, + 2187, 2205, 2213, 2239, 2237, 2216, 2229, 2241, 2267, 2258, + 2253, 2269, 2270, 2293, 2281, 2311, 2292, 2303, 2307, 2321, + 2315, 2337, 2326, 2329, 2347, 2332, 2377, 2361, 2365, 2369, + 2383, 2366, 2380, 2399, 2415, 2417, 2401, 2434, 2423, 2447, + 2433, 2436, 2451, 2439, 2465, 2457, 2473, 2490, 2496, 2479, + 2501, 2518, 2507, 2519, 2529, 2531, 2530, 2535, 0, 0, + 2130, 2179, 2215, 2229, 2315, 2503, 2525, 0, 2531, 2535, + + 2544, 0, 2538, 2550, 2561, 2563, 2549, 2552, 2556, 2568, + 2566, 0, 2573, 2566, 2566, 0, 0, 2568, 2584, 2571, + 2580, 0, 0, 0, 0, 2593, 2589, 2578, 0, 0, + 2595, 2583, 2585, 2601, 2599, 0, 2608, 2590, 2608, 2613, + 2599, 2602, 2602, 2622, 0, 2621, 2625, 2626, 0, 2613, + 2633, 0, 2635, 2637, 2638, 2641, 2643, 2647, 2660, 2671, + 2652, 2675, 2683, 2697, 2689, 2692, 2706, 2705, 2715, 2723, + 2734, 2740, 2737, 2759, 2738, 2746, 2769, 2775, 2777, 2774, + 2780, 2803, 2805, 2814, 2813, 2809, 2811, 2817, 2826, 2839, + 2848, 2854, 2843, 2857, 2865, 2867, 2889, 2871, 2879, 2888, + + 2897, 2913, 2922, 2923, 2911, 2934, 2951, 2945, 2937, 2953, + 2963, 2959, 2967, 2977, 2999, 2976, 2639, 0, 2640, 2650, + 2686, 2694, 0, 2731, 2768, 0, 0, 2851, 0, 0, + 0, 2900, 0, 2894, 0, 0, 2885, 0, 0, 2962, + 2982, 0, 2978, 2992, 0, 2986, 3005, 2987, 0, 3010, + 2997, 0, 0, 3006, 0, 3020, 3021, 3005, 0, 0, + 0, 0, 3014, 3025, 3029, 3030, 3031, 3041, 3053, 3042, + 3065, 3059, 3064, 3075, 3083, 3093, 3094, 3096, 3097, 3098, + 3119, 3107, 3109, 3115, 3131, 3132, 3137, 3133, 3147, 3161, + 3169, 3163, 3171, 3173, 3182, 3185, 3199, 3187, 3203, 3211, + + 3215, 3217, 3225, 3240, 3239, 3241, 3251, 3253, 3255, 3269, + 0, 0, 0, 0, 0, 3031, 0, 3084, 0, 0, + 0, 0, 3150, 0, 3136, 3206, 0, 0, 3228, 0, + 0, 3234, 3248, 3257, 0, 3265, 3277, 3279, 3290, 3291, + 3305, 3293, 3294, 3295, 3307, 3319, 3323, 3331, 3333, 3335, + 3344, 3345, 3347, 3361, 3357, 3359, 3385, 3387, 3363, 3369, + 3358, 0, 3378, 0, 3384, 0, 3379, 3390, 0, 3415, + 3409, 3418, 3417, 3427, 3419, 3421, 3450, 3431, 3449, 0, + 3438, 0, 0, 3453, 3455, 3469, 3471, 3472, 0, 0, + 3481, 3484, 3573, 3548, 3552, 189, 3556, 3560, 3564, 3568 + + } ; + +static yyconst flex_int16_t yy_def[901] = + { 0, + 893, 1, 893, 3, 893, 893, 893, 893, 894, 893, + 895, 893, 893, 893, 893, 893, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 897, + 897, 893, 898, 897, 899, 897, 897, 897, 897, 897, + 900, 900, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 893, 894, 895, 893, 893, 893, 893, + 893, 893, 893, 893, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 897, 897, 898, 899, 897, 897, 897, + 897, 897, 897, 897, 897, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 893, 893, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 897, 897, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + + 896, 896, 896, 896, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 896, + 896, 896, 896, 896, 896, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 896, 896, 896, 896, 896, 896, 896, 896, 896, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 896, 896, + 896, 896, 896, 52, 52, 52, 52, 52, 896, 896, + 52, 52, 0, 893, 893, 893, 893, 893, 893, 893 + + } ; + +static yyconst flex_int16_t yy_nxt[3639] = + { 0, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 10, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 33, 33, 33, 6, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 33, 33, 33, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 44, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + + 67, 67, 67, 40, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 67, 67, 67, + 74, 74, 74, 74, 80, 81, 82, 83, 86, 91, + 87, 110, 102, 93, 108, 116, 88, 103, 89, 111, + 109, 117, 121, 90, 118, 237, 122, 94, 119, 92, + 95, 96, 155, 74, 120, 86, 91, 87, 110, 102, + 93, 108, 116, 88, 103, 89, 111, 109, 117, 121, + 90, 118, 237, 122, 94, 119, 92, 95, 96, 97, + 104, 120, 85, 98, 131, 238, 105, 99, 123, 106, + + 112, 241, 107, 100, 242, 132, 101, 113, 114, 329, + 134, 133, 124, 115, 135, 236, 97, 104, 125, 126, + 98, 131, 238, 105, 99, 123, 106, 112, 241, 107, + 100, 242, 132, 101, 113, 114, 127, 134, 133, 124, + 115, 135, 150, 243, 128, 125, 126, 198, 129, 329, + 151, 130, 160, 147, 158, 148, 74, 74, 149, 152, + 153, 161, 162, 127, 163, 164, 252, 166, 328, 150, + 243, 128, 74, 74, 198, 129, 166, 151, 130, 136, + 147, 137, 148, 253, 138, 149, 152, 153, 80, 81, + 183, 139, 140, 252, 166, 184, 166, 155, 74, 236, + + 244, 161, 162, 166, 239, 191, 136, 79, 137, 166, + 253, 138, 240, 192, 245, 166, 260, 183, 139, 140, + 141, 142, 184, 166, 143, 197, 246, 244, 144, 166, + 77, 239, 191, 247, 145, 166, 166, 146, 235, 240, + 192, 245, 166, 260, 165, 160, 159, 141, 142, 158, + 154, 143, 197, 246, 261, 144, 166, 250, 84, 166, + 247, 145, 166, 79, 146, 154, 154, 251, 154, 154, + 154, 154, 154, 199, 154, 154, 154, 200, 166, 166, + 167, 261, 168, 201, 250, 189, 166, 248, 169, 249, + 170, 190, 262, 166, 251, 171, 78, 77, 166, 893, + + 199, 893, 893, 893, 200, 166, 166, 167, 893, 168, + 201, 267, 189, 893, 248, 169, 249, 170, 190, 262, + 166, 268, 171, 154, 154, 166, 154, 154, 154, 154, + 154, 202, 154, 154, 154, 203, 215, 231, 267, 172, + 216, 166, 893, 258, 259, 232, 269, 270, 268, 166, + 271, 166, 233, 234, 272, 893, 166, 277, 202, 173, + 893, 166, 203, 215, 231, 893, 172, 216, 166, 166, + 258, 259, 232, 269, 270, 282, 166, 271, 166, 233, + 234, 272, 273, 166, 277, 274, 173, 174, 166, 254, + 283, 166, 275, 263, 255, 264, 166, 276, 893, 265, + + 256, 175, 282, 284, 176, 177, 266, 257, 893, 273, + 285, 166, 274, 893, 174, 893, 254, 283, 166, 275, + 263, 255, 264, 290, 276, 278, 265, 256, 175, 893, + 284, 176, 177, 266, 257, 279, 893, 285, 166, 178, + 280, 281, 286, 179, 287, 291, 288, 180, 289, 292, + 290, 293, 278, 181, 294, 295, 182, 296, 297, 298, + 299, 300, 279, 166, 893, 893, 178, 280, 281, 286, + 179, 287, 291, 288, 180, 289, 292, 893, 293, 305, + 181, 294, 295, 182, 296, 297, 298, 299, 300, 301, + 166, 166, 303, 302, 306, 185, 309, 304, 310, 311, + + 307, 186, 312, 313, 187, 316, 305, 188, 308, 317, + 318, 166, 893, 893, 321, 893, 301, 893, 166, 303, + 302, 306, 185, 309, 304, 310, 311, 307, 186, 312, + 313, 187, 316, 314, 188, 308, 317, 318, 166, 166, + 193, 321, 319, 322, 315, 320, 323, 194, 195, 324, + 326, 327, 893, 196, 421, 893, 893, 422, 893, 166, + 314, 423, 325, 166, 893, 893, 166, 193, 893, 319, + 322, 315, 320, 323, 194, 195, 324, 326, 327, 166, + 196, 421, 166, 166, 422, 166, 166, 204, 423, 325, + 166, 166, 332, 893, 330, 166, 893, 331, 424, 166, + + 333, 205, 166, 166, 425, 166, 166, 206, 207, 166, + 166, 166, 166, 893, 204, 166, 893, 426, 166, 332, + 345, 330, 166, 166, 331, 424, 166, 333, 205, 166, + 166, 425, 166, 334, 206, 207, 335, 166, 166, 166, + 208, 893, 166, 336, 426, 166, 893, 345, 209, 893, + 166, 893, 210, 166, 337, 211, 893, 166, 166, 166, + 334, 427, 893, 335, 166, 166, 166, 208, 338, 166, + 336, 893, 166, 166, 353, 209, 339, 893, 166, 210, + 166, 337, 211, 340, 166, 166, 166, 212, 427, 166, + 428, 166, 166, 893, 429, 338, 166, 430, 213, 166, + + 166, 353, 431, 339, 214, 166, 341, 166, 342, 893, + 340, 166, 893, 893, 212, 432, 166, 428, 166, 166, + 343, 429, 346, 166, 430, 213, 166, 166, 893, 431, + 344, 214, 433, 341, 166, 342, 351, 352, 166, 217, + 166, 218, 432, 166, 219, 166, 166, 343, 434, 346, + 166, 220, 221, 893, 166, 354, 893, 344, 355, 433, + 166, 166, 893, 351, 352, 166, 217, 166, 218, 437, + 166, 219, 166, 438, 166, 434, 893, 893, 220, 221, + 166, 360, 354, 435, 893, 355, 893, 166, 166, 222, + 223, 166, 166, 224, 166, 166, 437, 225, 436, 893, + + 438, 166, 893, 226, 361, 362, 227, 166, 360, 166, + 435, 166, 893, 166, 893, 166, 222, 223, 166, 166, + 224, 166, 166, 893, 225, 436, 363, 166, 893, 166, + 226, 361, 362, 227, 893, 439, 166, 364, 166, 166, + 166, 166, 166, 166, 893, 440, 166, 166, 441, 166, + 228, 166, 229, 363, 166, 230, 166, 366, 893, 365, + 367, 166, 439, 166, 364, 893, 166, 893, 166, 166, + 166, 377, 440, 893, 166, 441, 166, 228, 166, 229, + 893, 166, 230, 166, 366, 376, 365, 367, 166, 347, + 166, 166, 368, 166, 348, 166, 166, 369, 377, 442, + + 349, 166, 370, 166, 375, 166, 378, 350, 166, 443, + 166, 166, 376, 166, 893, 166, 347, 444, 166, 368, + 166, 348, 166, 445, 369, 166, 442, 349, 166, 370, + 166, 375, 166, 378, 350, 381, 443, 382, 166, 166, + 166, 356, 166, 357, 444, 446, 893, 358, 447, 166, + 445, 893, 166, 166, 359, 379, 448, 380, 166, 166, + 387, 893, 381, 166, 382, 893, 166, 893, 356, 166, + 357, 383, 446, 166, 358, 447, 166, 893, 166, 893, + 166, 359, 379, 448, 380, 166, 166, 387, 166, 166, + 166, 371, 166, 166, 389, 893, 166, 384, 383, 388, + + 166, 372, 166, 166, 385, 166, 373, 374, 166, 166, + 893, 893, 166, 166, 449, 166, 166, 386, 371, 166, + 166, 389, 166, 166, 384, 166, 388, 166, 372, 166, + 166, 385, 893, 373, 374, 166, 166, 390, 166, 166, + 166, 449, 391, 166, 386, 166, 893, 166, 893, 166, + 166, 393, 166, 394, 166, 166, 392, 395, 166, 166, + 893, 398, 893, 166, 390, 166, 450, 166, 451, 391, + 166, 452, 166, 166, 166, 166, 396, 893, 393, 166, + 394, 397, 166, 392, 395, 166, 166, 166, 398, 166, + 166, 166, 399, 450, 166, 451, 453, 166, 452, 454, + + 166, 402, 166, 396, 400, 455, 166, 166, 397, 166, + 405, 166, 401, 166, 166, 166, 166, 166, 166, 399, + 403, 404, 406, 453, 166, 166, 454, 166, 402, 456, + 893, 400, 455, 166, 166, 166, 166, 405, 166, 401, + 166, 893, 166, 893, 166, 166, 166, 403, 404, 406, + 166, 166, 166, 457, 166, 893, 456, 410, 407, 409, + 166, 166, 166, 166, 893, 412, 166, 893, 413, 408, + 166, 166, 166, 166, 419, 893, 458, 166, 166, 411, + 457, 166, 166, 166, 410, 407, 409, 166, 166, 416, + 166, 415, 412, 166, 166, 413, 408, 166, 166, 414, + + 166, 419, 166, 458, 417, 459, 411, 166, 166, 166, + 166, 462, 460, 166, 166, 463, 416, 418, 415, 464, + 166, 166, 461, 465, 166, 466, 414, 166, 420, 166, + 467, 417, 459, 166, 166, 468, 469, 470, 462, 460, + 166, 471, 463, 472, 418, 473, 464, 166, 474, 461, + 465, 166, 466, 475, 476, 420, 479, 467, 477, 480, + 166, 481, 468, 469, 470, 482, 483, 484, 471, 485, + 472, 486, 473, 487, 488, 474, 489, 478, 490, 491, + 475, 476, 492, 479, 493, 477, 480, 494, 481, 495, + 497, 496, 482, 483, 484, 498, 485, 499, 486, 500, + + 487, 488, 501, 489, 478, 490, 491, 502, 503, 492, + 504, 493, 166, 505, 494, 589, 495, 497, 496, 893, + 893, 166, 498, 506, 499, 166, 500, 166, 590, 501, + 591, 166, 166, 166, 502, 503, 166, 504, 507, 166, + 505, 166, 589, 166, 166, 166, 508, 166, 166, 893, + 506, 166, 166, 893, 166, 590, 166, 591, 166, 166, + 166, 592, 509, 166, 166, 507, 166, 893, 166, 893, + 166, 166, 166, 508, 166, 166, 166, 511, 166, 166, + 166, 513, 510, 166, 893, 893, 166, 893, 592, 509, + 514, 166, 512, 166, 166, 166, 166, 893, 166, 166, + + 166, 893, 166, 166, 511, 893, 166, 166, 513, 510, + 516, 518, 515, 166, 166, 166, 893, 514, 166, 512, + 522, 166, 166, 166, 166, 166, 166, 166, 519, 893, + 166, 517, 521, 524, 166, 166, 166, 516, 518, 515, + 166, 166, 166, 520, 166, 166, 893, 522, 166, 166, + 893, 166, 593, 527, 166, 519, 166, 166, 517, 521, + 524, 166, 166, 166, 523, 893, 166, 166, 526, 166, + 520, 166, 166, 166, 166, 166, 166, 525, 531, 593, + 527, 166, 166, 166, 893, 528, 166, 166, 529, 530, + 166, 523, 166, 166, 166, 526, 166, 594, 166, 166, + + 166, 166, 166, 166, 525, 531, 166, 166, 893, 166, + 166, 532, 528, 166, 166, 529, 530, 166, 893, 166, + 166, 166, 535, 166, 594, 166, 166, 533, 534, 166, + 166, 166, 166, 166, 166, 536, 893, 166, 532, 893, + 166, 166, 595, 541, 893, 537, 542, 166, 893, 535, + 166, 166, 166, 166, 533, 534, 166, 893, 166, 166, + 166, 166, 536, 166, 166, 543, 166, 166, 166, 595, + 541, 538, 537, 542, 540, 539, 166, 893, 166, 166, + 166, 596, 893, 166, 166, 166, 544, 166, 166, 166, + 166, 166, 543, 166, 166, 166, 545, 549, 538, 551, + + 166, 540, 539, 166, 547, 546, 166, 166, 596, 166, + 166, 166, 166, 544, 166, 166, 166, 166, 893, 597, + 166, 166, 166, 545, 549, 548, 551, 166, 598, 893, + 166, 547, 546, 166, 166, 552, 166, 166, 550, 166, + 166, 166, 166, 166, 166, 553, 597, 166, 166, 166, + 893, 166, 548, 559, 166, 598, 554, 166, 556, 166, + 166, 166, 552, 166, 555, 550, 166, 166, 166, 166, + 166, 166, 553, 166, 166, 166, 166, 560, 166, 166, + 559, 166, 599, 554, 893, 556, 166, 166, 558, 561, + 166, 555, 557, 166, 166, 166, 166, 166, 166, 166, + + 166, 166, 166, 166, 560, 893, 166, 600, 562, 599, + 893, 563, 569, 166, 564, 558, 561, 166, 893, 557, + 166, 166, 166, 166, 166, 565, 166, 566, 166, 166, + 166, 166, 166, 166, 600, 562, 568, 166, 563, 569, + 166, 564, 570, 567, 166, 166, 166, 893, 166, 166, + 166, 166, 565, 166, 566, 166, 166, 893, 166, 166, + 166, 572, 166, 568, 166, 166, 166, 166, 893, 570, + 567, 166, 166, 166, 571, 166, 166, 166, 166, 166, + 166, 601, 573, 166, 574, 166, 602, 166, 572, 166, + 575, 166, 166, 166, 166, 577, 166, 166, 166, 166, + + 576, 571, 893, 166, 166, 166, 166, 893, 601, 573, + 166, 574, 166, 602, 166, 166, 166, 575, 166, 578, + 603, 166, 577, 166, 166, 166, 166, 576, 893, 166, + 166, 579, 166, 580, 166, 581, 604, 166, 583, 605, + 582, 166, 166, 166, 166, 166, 578, 603, 166, 166, + 584, 606, 166, 607, 166, 166, 166, 166, 579, 166, + 580, 166, 581, 604, 166, 583, 605, 582, 166, 608, + 166, 166, 166, 585, 586, 166, 166, 584, 606, 166, + 607, 166, 166, 587, 166, 609, 166, 588, 610, 611, + 166, 166, 612, 613, 614, 615, 608, 166, 616, 617, + + 585, 586, 166, 618, 166, 621, 166, 619, 622, 623, + 587, 166, 609, 624, 588, 610, 611, 166, 620, 612, + 613, 614, 615, 625, 626, 616, 617, 627, 628, 629, + 618, 166, 621, 630, 619, 622, 623, 631, 632, 633, + 624, 634, 635, 636, 637, 620, 638, 639, 640, 641, + 625, 626, 642, 643, 627, 628, 629, 644, 645, 646, + 630, 647, 648, 649, 631, 632, 633, 650, 634, 635, + 636, 637, 651, 638, 639, 640, 641, 652, 166, 642, + 643, 166, 166, 166, 644, 645, 646, 657, 647, 648, + 649, 653, 166, 658, 650, 654, 656, 166, 166, 651, + + 893, 655, 166, 166, 652, 166, 893, 166, 166, 166, + 166, 166, 166, 166, 657, 166, 893, 166, 653, 166, + 658, 659, 654, 656, 166, 166, 661, 166, 655, 166, + 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, + 166, 662, 166, 663, 166, 660, 166, 166, 659, 166, + 893, 666, 166, 661, 166, 166, 166, 166, 166, 166, + 166, 665, 166, 166, 166, 664, 166, 717, 662, 166, + 663, 893, 660, 166, 166, 166, 166, 166, 666, 166, + 893, 668, 166, 166, 166, 667, 166, 166, 665, 166, + 166, 166, 664, 166, 717, 718, 166, 166, 669, 166, + + 670, 671, 166, 166, 166, 893, 166, 166, 668, 166, + 166, 166, 667, 166, 166, 672, 166, 166, 166, 166, + 166, 166, 718, 166, 166, 669, 166, 670, 671, 166, + 166, 719, 166, 166, 166, 673, 166, 166, 166, 674, + 166, 166, 672, 166, 720, 166, 166, 166, 166, 166, + 166, 675, 166, 166, 677, 166, 166, 166, 719, 166, + 893, 893, 673, 166, 676, 166, 674, 166, 166, 166, + 166, 720, 166, 166, 166, 166, 166, 166, 675, 166, + 166, 677, 166, 166, 166, 166, 166, 679, 680, 166, + 166, 676, 166, 678, 166, 893, 166, 166, 681, 682, + + 166, 166, 166, 166, 166, 166, 166, 893, 166, 166, + 166, 683, 166, 166, 679, 680, 166, 166, 893, 166, + 678, 166, 684, 166, 166, 681, 682, 166, 166, 166, + 166, 166, 166, 166, 685, 166, 166, 166, 683, 166, + 721, 893, 688, 166, 166, 166, 166, 166, 166, 684, + 166, 166, 686, 166, 166, 166, 166, 166, 166, 689, + 687, 685, 166, 166, 166, 166, 166, 721, 166, 688, + 166, 893, 166, 166, 166, 166, 690, 692, 166, 686, + 166, 166, 166, 166, 166, 166, 689, 687, 893, 166, + 166, 691, 166, 166, 693, 166, 166, 166, 694, 166, + + 166, 166, 166, 690, 692, 166, 893, 695, 166, 166, + 166, 696, 166, 166, 893, 166, 166, 166, 691, 166, + 166, 693, 893, 166, 166, 694, 166, 697, 166, 166, + 699, 166, 166, 166, 695, 166, 893, 166, 696, 166, + 166, 698, 166, 166, 166, 893, 166, 701, 893, 166, + 166, 166, 703, 166, 697, 705, 893, 699, 166, 166, + 166, 702, 166, 166, 166, 700, 166, 166, 698, 166, + 166, 704, 166, 166, 701, 166, 166, 166, 166, 703, + 166, 166, 705, 166, 893, 893, 166, 166, 702, 166, + 166, 706, 700, 166, 166, 166, 166, 166, 704, 166, + + 166, 166, 166, 707, 708, 893, 166, 893, 166, 166, + 166, 710, 166, 711, 166, 166, 166, 166, 706, 893, + 166, 709, 166, 166, 893, 713, 166, 893, 166, 722, + 707, 708, 166, 166, 166, 714, 166, 166, 710, 166, + 711, 723, 166, 166, 166, 166, 716, 166, 709, 712, + 166, 166, 713, 166, 166, 166, 722, 724, 725, 166, + 726, 166, 714, 715, 166, 166, 166, 166, 723, 727, + 166, 166, 166, 716, 166, 728, 712, 729, 166, 730, + 731, 166, 166, 732, 724, 725, 733, 726, 734, 735, + 715, 736, 166, 166, 166, 737, 727, 738, 166, 739, + + 740, 741, 728, 742, 729, 743, 730, 731, 744, 745, + 732, 746, 747, 733, 748, 734, 735, 749, 736, 750, + 751, 752, 737, 753, 738, 754, 739, 740, 741, 755, + 742, 756, 743, 757, 758, 744, 745, 759, 746, 747, + 760, 748, 761, 762, 749, 763, 750, 751, 752, 893, + 753, 166, 754, 166, 166, 811, 755, 765, 756, 766, + 757, 758, 767, 166, 759, 812, 813, 760, 770, 761, + 762, 166, 763, 166, 166, 764, 166, 166, 166, 166, + 166, 166, 811, 166, 765, 768, 766, 166, 166, 767, + 166, 166, 812, 813, 893, 770, 166, 769, 166, 166, + + 166, 166, 764, 166, 166, 773, 166, 166, 166, 771, + 166, 166, 768, 166, 166, 166, 814, 815, 166, 166, + 772, 166, 166, 166, 769, 166, 166, 893, 166, 893, + 775, 776, 773, 166, 166, 166, 771, 774, 166, 777, + 166, 166, 166, 814, 815, 816, 166, 772, 166, 166, + 166, 166, 166, 166, 166, 166, 166, 775, 776, 166, + 166, 782, 166, 893, 774, 778, 777, 780, 166, 166, + 166, 779, 816, 166, 166, 166, 166, 166, 166, 781, + 166, 166, 166, 166, 893, 166, 166, 783, 782, 166, + 166, 166, 778, 166, 780, 166, 166, 166, 779, 817, + + 166, 166, 166, 166, 784, 166, 781, 893, 785, 166, + 166, 166, 166, 166, 783, 893, 166, 166, 166, 166, + 166, 787, 166, 166, 893, 166, 817, 166, 893, 166, + 166, 784, 166, 166, 786, 785, 789, 166, 166, 166, + 166, 166, 166, 166, 788, 166, 166, 166, 787, 166, + 166, 790, 166, 166, 166, 166, 166, 166, 893, 166, + 166, 786, 166, 789, 166, 818, 166, 791, 166, 166, + 166, 788, 166, 166, 166, 166, 166, 166, 790, 166, + 166, 793, 166, 166, 166, 792, 166, 796, 893, 166, + 166, 166, 818, 166, 791, 166, 794, 166, 893, 797, + + 166, 166, 166, 166, 166, 166, 166, 166, 793, 798, + 166, 166, 792, 166, 796, 166, 819, 166, 795, 820, + 166, 821, 166, 794, 166, 166, 797, 166, 166, 166, + 166, 166, 166, 166, 166, 801, 798, 800, 166, 166, + 166, 802, 166, 819, 799, 795, 820, 166, 821, 166, + 166, 166, 166, 166, 166, 893, 166, 805, 166, 166, + 166, 166, 801, 803, 800, 166, 166, 166, 802, 806, + 166, 799, 893, 166, 166, 808, 166, 166, 807, 166, + 166, 166, 804, 166, 805, 166, 166, 166, 166, 166, + 803, 822, 166, 166, 166, 166, 806, 166, 823, 166, + + 166, 824, 808, 166, 825, 807, 166, 809, 166, 804, + 166, 810, 166, 166, 166, 166, 166, 826, 822, 166, + 166, 827, 166, 828, 829, 823, 166, 830, 824, 831, + 166, 825, 832, 833, 809, 166, 834, 835, 810, 166, + 166, 836, 166, 861, 826, 166, 166, 838, 827, 893, + 828, 829, 893, 893, 830, 837, 831, 166, 166, 832, + 833, 166, 166, 834, 835, 166, 166, 166, 836, 166, + 861, 839, 166, 166, 838, 166, 840, 166, 166, 841, + 166, 166, 837, 893, 166, 166, 893, 893, 166, 166, + 842, 166, 166, 166, 166, 166, 166, 843, 839, 166, + + 166, 166, 166, 840, 166, 166, 841, 166, 166, 166, + 166, 166, 166, 844, 166, 862, 166, 842, 166, 166, + 893, 893, 166, 166, 843, 166, 166, 166, 166, 166, + 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, + 844, 166, 862, 166, 845, 166, 166, 166, 166, 848, + 166, 846, 166, 166, 893, 166, 166, 166, 166, 166, + 166, 166, 166, 166, 863, 864, 847, 166, 166, 166, + 166, 845, 166, 166, 166, 166, 848, 166, 846, 166, + 166, 850, 166, 166, 849, 166, 893, 166, 893, 852, + 166, 863, 864, 847, 166, 166, 166, 166, 166, 166, + + 166, 166, 851, 166, 166, 166, 166, 166, 850, 166, + 166, 849, 166, 854, 166, 166, 852, 855, 853, 166, + 893, 166, 865, 166, 166, 166, 166, 166, 166, 851, + 166, 166, 166, 166, 166, 166, 166, 857, 856, 166, + 854, 166, 166, 893, 855, 853, 166, 166, 166, 865, + 166, 166, 858, 166, 166, 166, 166, 166, 166, 866, + 166, 166, 166, 867, 857, 856, 166, 166, 166, 166, + 859, 166, 868, 869, 166, 166, 166, 166, 166, 858, + 166, 166, 166, 166, 166, 166, 866, 166, 166, 166, + 867, 166, 860, 166, 166, 166, 166, 859, 166, 868, + + 869, 166, 166, 166, 166, 166, 166, 166, 166, 166, + 166, 166, 166, 166, 166, 166, 166, 870, 166, 860, + 166, 166, 166, 166, 893, 871, 166, 166, 166, 166, + 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, + 166, 166, 166, 166, 870, 872, 893, 166, 166, 166, + 166, 166, 871, 166, 166, 166, 166, 166, 166, 166, + 874, 166, 166, 166, 873, 893, 166, 166, 166, 166, + 166, 166, 872, 166, 166, 166, 166, 166, 166, 878, + 166, 166, 166, 166, 893, 166, 166, 874, 166, 879, + 166, 873, 875, 166, 166, 166, 166, 166, 166, 166, + + 166, 166, 166, 166, 166, 166, 878, 166, 166, 880, + 166, 877, 166, 881, 876, 882, 879, 883, 893, 875, + 166, 166, 166, 166, 166, 166, 166, 893, 166, 893, + 166, 166, 166, 166, 166, 166, 880, 166, 877, 893, + 881, 876, 882, 166, 883, 166, 884, 166, 166, 885, + 166, 166, 166, 166, 166, 166, 886, 887, 166, 893, + 166, 166, 166, 166, 166, 889, 166, 166, 890, 891, + 166, 166, 166, 884, 166, 893, 885, 888, 166, 893, + 166, 166, 166, 886, 887, 166, 166, 166, 166, 166, + 166, 166, 889, 166, 166, 890, 891, 166, 166, 892, + + 166, 893, 893, 893, 888, 166, 893, 166, 166, 893, + 893, 893, 166, 166, 166, 166, 166, 166, 166, 893, + 166, 893, 893, 893, 166, 893, 892, 166, 893, 893, + 893, 893, 166, 893, 166, 166, 893, 893, 893, 893, + 893, 893, 893, 893, 166, 893, 893, 166, 75, 893, + 893, 75, 76, 893, 76, 76, 154, 893, 154, 154, + 156, 893, 156, 156, 157, 893, 157, 157, 166, 893, + 166, 166, 5, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, + + 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893 + } ; + +static yyconst flex_int16_t yy_chk[3639] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 7, 7, 8, 8, 14, 14, 15, 15, 17, 18, + 17, 24, 21, 19, 23, 26, 17, 21, 17, 24, + 23, 27, 29, 17, 28, 86, 29, 19, 28, 18, + 19, 19, 41, 41, 28, 17, 18, 17, 24, 21, + 19, 23, 26, 17, 21, 17, 24, 23, 27, 29, + 17, 28, 86, 29, 19, 28, 18, 19, 19, 20, + 22, 28, 896, 20, 32, 87, 22, 20, 30, 22, + + 25, 89, 22, 20, 89, 32, 20, 25, 25, 329, + 34, 32, 30, 25, 34, 236, 20, 22, 30, 30, + 20, 32, 87, 22, 20, 30, 22, 25, 89, 22, + 20, 89, 32, 20, 25, 25, 31, 34, 32, 30, + 25, 34, 38, 90, 31, 30, 30, 61, 31, 161, + 38, 31, 160, 37, 157, 37, 42, 42, 37, 39, + 39, 48, 48, 31, 49, 49, 96, 61, 156, 38, + 90, 31, 74, 74, 61, 31, 55, 38, 31, 35, + 37, 35, 37, 97, 35, 37, 39, 39, 81, 81, + 55, 35, 35, 96, 61, 55, 55, 155, 155, 80, + + 91, 162, 162, 55, 88, 58, 35, 79, 35, 58, + 97, 35, 88, 58, 91, 60, 100, 55, 35, 35, + 36, 36, 55, 55, 36, 60, 93, 91, 36, 58, + 76, 88, 58, 93, 36, 60, 58, 36, 75, 88, + 58, 91, 60, 100, 50, 47, 46, 36, 36, 45, + 43, 36, 60, 93, 101, 36, 58, 95, 16, 67, + 93, 36, 60, 13, 36, 51, 51, 95, 51, 51, + 51, 51, 51, 62, 51, 51, 51, 62, 57, 67, + 51, 101, 51, 62, 95, 57, 67, 94, 51, 94, + 51, 57, 102, 62, 95, 51, 12, 11, 57, 5, + + 62, 0, 0, 0, 62, 57, 67, 51, 0, 51, + 62, 104, 57, 0, 94, 51, 94, 51, 57, 102, + 62, 105, 51, 52, 52, 57, 52, 52, 52, 52, + 52, 63, 52, 52, 52, 63, 68, 72, 104, 52, + 68, 72, 0, 99, 99, 72, 106, 107, 105, 73, + 108, 63, 73, 73, 109, 0, 68, 113, 63, 52, + 0, 72, 63, 68, 72, 0, 52, 68, 72, 73, + 99, 99, 72, 106, 107, 115, 73, 108, 63, 73, + 73, 109, 110, 68, 113, 110, 52, 53, 72, 98, + 116, 53, 111, 103, 98, 103, 73, 111, 0, 103, + + 98, 53, 115, 117, 53, 53, 103, 98, 0, 110, + 118, 53, 110, 0, 53, 0, 98, 116, 53, 111, + 103, 98, 103, 121, 111, 114, 103, 98, 53, 0, + 117, 53, 53, 103, 98, 114, 0, 118, 53, 54, + 114, 114, 119, 54, 119, 122, 120, 54, 120, 123, + 121, 124, 114, 54, 125, 126, 54, 127, 129, 130, + 131, 132, 114, 54, 0, 0, 54, 114, 114, 119, + 54, 119, 122, 120, 54, 120, 123, 0, 124, 135, + 54, 125, 126, 54, 127, 129, 130, 131, 132, 133, + 54, 56, 134, 133, 136, 56, 138, 134, 139, 140, + + 137, 56, 141, 142, 56, 144, 135, 56, 137, 145, + 146, 56, 0, 0, 148, 0, 133, 0, 56, 134, + 133, 136, 56, 138, 134, 139, 140, 137, 56, 141, + 142, 56, 144, 143, 56, 137, 145, 146, 56, 59, + 59, 148, 147, 149, 143, 147, 150, 59, 59, 151, + 152, 153, 0, 59, 238, 0, 0, 240, 0, 59, + 143, 241, 151, 166, 0, 0, 59, 59, 0, 147, + 149, 143, 147, 150, 59, 59, 151, 152, 153, 173, + 59, 238, 168, 166, 240, 169, 59, 64, 241, 151, + 166, 64, 169, 0, 167, 167, 0, 168, 244, 173, + + 169, 64, 168, 177, 245, 169, 173, 64, 64, 168, + 166, 64, 169, 0, 64, 167, 0, 246, 64, 169, + 177, 167, 167, 177, 168, 244, 173, 169, 64, 168, + 177, 245, 169, 170, 64, 64, 170, 170, 64, 65, + 65, 0, 167, 171, 246, 171, 0, 177, 65, 0, + 177, 0, 65, 172, 172, 65, 0, 170, 181, 65, + 170, 247, 0, 170, 170, 171, 65, 65, 172, 174, + 171, 0, 171, 172, 181, 65, 174, 0, 181, 65, + 172, 172, 65, 174, 170, 181, 65, 66, 247, 174, + 248, 66, 171, 0, 249, 172, 174, 250, 66, 175, + + 172, 181, 251, 174, 66, 181, 175, 178, 175, 0, + 174, 66, 0, 0, 66, 253, 174, 248, 66, 175, + 176, 249, 178, 180, 250, 66, 175, 178, 0, 251, + 176, 66, 254, 175, 178, 175, 180, 180, 66, 69, + 176, 69, 253, 180, 69, 182, 175, 176, 255, 178, + 180, 69, 69, 0, 178, 182, 0, 176, 183, 254, + 183, 69, 0, 180, 180, 182, 69, 176, 69, 257, + 180, 69, 182, 258, 185, 255, 0, 0, 69, 69, + 183, 185, 182, 256, 0, 183, 0, 183, 69, 70, + 70, 186, 182, 70, 185, 187, 257, 70, 256, 0, + + 258, 185, 0, 70, 186, 187, 70, 183, 185, 193, + 256, 186, 0, 70, 0, 187, 70, 70, 186, 188, + 70, 185, 187, 0, 70, 256, 188, 189, 0, 193, + 70, 186, 187, 70, 0, 259, 193, 189, 186, 188, + 70, 71, 187, 191, 0, 260, 188, 189, 261, 190, + 71, 198, 71, 188, 189, 71, 193, 191, 0, 190, + 191, 71, 259, 191, 189, 0, 188, 0, 71, 190, + 191, 198, 260, 0, 189, 261, 190, 71, 198, 71, + 0, 197, 71, 192, 191, 197, 190, 191, 71, 179, + 191, 194, 192, 179, 179, 196, 190, 192, 198, 262, + + 179, 197, 194, 192, 196, 199, 199, 179, 197, 263, + 192, 194, 197, 179, 0, 196, 179, 264, 194, 192, + 179, 179, 196, 265, 192, 199, 262, 179, 197, 194, + 192, 196, 199, 199, 179, 201, 263, 201, 194, 201, + 179, 184, 196, 184, 264, 266, 0, 184, 267, 200, + 265, 0, 199, 206, 184, 200, 269, 200, 202, 201, + 206, 0, 201, 184, 201, 0, 201, 0, 184, 200, + 184, 202, 266, 206, 184, 267, 200, 0, 202, 0, + 206, 184, 200, 269, 200, 202, 201, 206, 203, 204, + 184, 195, 195, 208, 208, 0, 200, 203, 202, 207, + + 206, 195, 205, 207, 204, 202, 195, 195, 203, 204, + 0, 0, 195, 208, 270, 203, 204, 205, 195, 195, + 208, 208, 205, 207, 203, 209, 207, 211, 195, 205, + 207, 204, 0, 195, 195, 203, 204, 210, 210, 195, + 208, 270, 211, 212, 205, 209, 0, 211, 0, 205, + 207, 213, 209, 214, 211, 213, 212, 214, 210, 216, + 0, 216, 0, 212, 210, 210, 271, 215, 272, 211, + 212, 273, 209, 214, 211, 213, 215, 0, 213, 216, + 214, 215, 213, 212, 214, 210, 216, 215, 216, 217, + 212, 219, 217, 271, 215, 272, 274, 218, 273, 275, + + 214, 219, 213, 215, 218, 276, 216, 220, 215, 217, + 222, 219, 218, 222, 215, 223, 217, 218, 219, 217, + 220, 221, 223, 274, 218, 221, 275, 220, 219, 277, + 0, 218, 276, 222, 220, 223, 217, 222, 219, 218, + 222, 0, 223, 0, 218, 221, 226, 220, 221, 223, + 224, 225, 221, 278, 220, 0, 277, 226, 224, 225, + 222, 228, 223, 227, 0, 228, 226, 0, 228, 224, + 224, 225, 221, 226, 233, 0, 279, 224, 225, 227, + 278, 228, 231, 227, 226, 224, 225, 230, 228, 231, + 227, 230, 228, 226, 233, 228, 224, 224, 225, 229, + + 229, 233, 231, 279, 232, 280, 227, 230, 228, 231, + 227, 282, 281, 234, 230, 283, 231, 232, 230, 285, + 229, 233, 281, 286, 232, 287, 229, 229, 234, 231, + 288, 232, 280, 234, 230, 289, 290, 291, 282, 281, + 234, 292, 283, 294, 232, 295, 285, 229, 296, 281, + 286, 232, 287, 297, 298, 234, 300, 288, 299, 301, + 234, 302, 289, 290, 291, 303, 304, 305, 292, 306, + 294, 307, 295, 309, 310, 296, 311, 299, 312, 314, + 297, 298, 315, 300, 316, 299, 301, 318, 302, 319, + 320, 319, 303, 304, 305, 321, 306, 322, 307, 323, + + 309, 310, 324, 311, 299, 312, 314, 325, 326, 315, + 327, 316, 330, 331, 318, 421, 319, 320, 319, 0, + 0, 332, 321, 333, 322, 335, 323, 336, 422, 324, + 423, 334, 330, 331, 325, 326, 337, 327, 334, 330, + 331, 332, 421, 333, 338, 335, 337, 336, 332, 0, + 333, 334, 335, 0, 336, 422, 337, 423, 334, 330, + 331, 424, 338, 337, 338, 334, 342, 0, 332, 0, + 333, 338, 335, 337, 336, 339, 341, 340, 334, 340, + 345, 342, 339, 337, 0, 0, 342, 0, 424, 338, + 343, 338, 341, 342, 343, 339, 341, 0, 344, 340, + + 345, 0, 339, 341, 340, 0, 340, 345, 342, 339, + 346, 348, 344, 342, 343, 348, 0, 343, 344, 341, + 351, 343, 339, 341, 347, 344, 340, 345, 349, 0, + 346, 347, 350, 353, 350, 348, 353, 346, 348, 344, + 351, 343, 348, 349, 347, 344, 0, 351, 349, 352, + 0, 347, 425, 356, 350, 349, 353, 346, 347, 350, + 353, 350, 348, 353, 352, 0, 354, 351, 355, 352, + 349, 347, 355, 356, 358, 349, 352, 354, 360, 425, + 356, 350, 359, 353, 0, 357, 354, 357, 358, 359, + 361, 352, 355, 354, 358, 355, 352, 427, 360, 355, + + 356, 358, 359, 362, 354, 360, 365, 357, 0, 359, + 361, 362, 357, 354, 357, 358, 359, 361, 0, 355, + 363, 358, 365, 362, 427, 360, 365, 363, 364, 359, + 362, 364, 366, 365, 357, 366, 0, 361, 362, 0, + 363, 367, 428, 371, 0, 367, 372, 363, 0, 365, + 362, 364, 366, 365, 363, 364, 368, 0, 364, 366, + 369, 367, 366, 371, 370, 373, 372, 363, 367, 428, + 371, 368, 367, 372, 370, 369, 368, 0, 364, 366, + 369, 429, 0, 368, 370, 373, 374, 369, 367, 375, + 371, 370, 373, 372, 377, 376, 374, 379, 368, 381, + + 381, 370, 369, 368, 376, 375, 374, 369, 429, 375, + 378, 370, 373, 374, 377, 376, 375, 379, 0, 430, + 381, 377, 376, 374, 379, 378, 381, 381, 431, 0, + 378, 376, 375, 374, 380, 382, 375, 378, 380, 382, + 384, 377, 376, 383, 379, 383, 430, 381, 385, 386, + 0, 387, 378, 390, 380, 431, 384, 378, 387, 382, + 384, 380, 382, 383, 385, 380, 382, 384, 385, 386, + 383, 387, 383, 390, 389, 385, 386, 391, 387, 388, + 390, 380, 433, 384, 0, 387, 382, 384, 389, 392, + 383, 385, 388, 392, 389, 385, 386, 391, 387, 388, + + 390, 389, 393, 394, 391, 0, 388, 434, 392, 433, + 0, 393, 399, 392, 394, 389, 392, 395, 0, 388, + 392, 389, 393, 394, 391, 395, 388, 396, 397, 393, + 394, 396, 399, 398, 434, 392, 398, 395, 393, 399, + 392, 394, 400, 397, 395, 401, 403, 0, 397, 393, + 394, 396, 395, 398, 396, 397, 402, 0, 396, 399, + 398, 403, 400, 398, 395, 401, 403, 404, 0, 400, + 397, 406, 401, 403, 402, 397, 402, 405, 396, 407, + 398, 435, 404, 402, 405, 408, 436, 404, 403, 400, + 407, 406, 401, 403, 404, 409, 410, 405, 406, 407, + + 408, 402, 0, 402, 405, 408, 407, 0, 435, 404, + 411, 405, 408, 436, 404, 409, 410, 407, 406, 411, + 438, 412, 409, 410, 405, 413, 407, 408, 0, 415, + 411, 412, 408, 412, 416, 413, 439, 411, 415, 440, + 414, 412, 409, 410, 414, 413, 411, 438, 412, 415, + 416, 442, 413, 443, 416, 417, 415, 411, 412, 418, + 412, 416, 413, 439, 414, 415, 440, 414, 412, 444, + 419, 414, 413, 417, 418, 417, 415, 416, 442, 418, + 443, 416, 417, 419, 420, 445, 418, 420, 446, 450, + 419, 414, 451, 453, 455, 456, 444, 419, 457, 458, + + 417, 418, 417, 459, 420, 462, 418, 460, 466, 468, + 419, 420, 445, 469, 420, 446, 450, 419, 460, 451, + 453, 455, 456, 470, 471, 457, 458, 473, 474, 475, + 459, 420, 462, 476, 460, 466, 468, 477, 480, 481, + 469, 482, 483, 484, 485, 460, 486, 488, 489, 490, + 470, 471, 491, 493, 473, 474, 475, 494, 495, 496, + 476, 497, 498, 499, 477, 480, 481, 500, 482, 483, + 484, 485, 502, 486, 488, 489, 490, 503, 505, 491, + 493, 507, 506, 508, 494, 495, 496, 509, 497, 498, + 499, 505, 510, 511, 500, 506, 508, 511, 505, 502, + + 0, 507, 506, 508, 503, 505, 0, 509, 507, 506, + 508, 514, 510, 512, 509, 516, 0, 511, 505, 510, + 511, 512, 506, 508, 511, 505, 514, 515, 507, 506, + 508, 514, 513, 512, 509, 516, 517, 521, 514, 510, + 512, 515, 516, 517, 511, 513, 519, 515, 512, 518, + 0, 520, 513, 514, 515, 520, 517, 521, 514, 513, + 512, 519, 516, 517, 521, 518, 519, 591, 515, 518, + 517, 0, 513, 519, 515, 520, 518, 523, 520, 513, + 0, 523, 520, 517, 521, 522, 525, 522, 519, 526, + 527, 524, 518, 519, 591, 592, 518, 523, 524, 528, + + 526, 527, 520, 531, 523, 0, 525, 522, 523, 526, + 527, 524, 522, 525, 522, 528, 526, 527, 524, 528, + 529, 532, 592, 531, 523, 524, 528, 526, 527, 533, + 531, 593, 536, 525, 522, 529, 526, 527, 524, 530, + 529, 532, 528, 530, 594, 537, 528, 529, 532, 533, + 531, 534, 536, 535, 537, 534, 533, 538, 593, 536, + 0, 0, 529, 530, 535, 537, 530, 529, 532, 541, + 530, 594, 537, 535, 540, 534, 533, 538, 534, 536, + 535, 537, 534, 539, 538, 542, 543, 540, 541, 541, + 530, 535, 537, 539, 540, 0, 541, 545, 542, 543, + + 535, 540, 534, 539, 538, 542, 543, 0, 547, 544, + 539, 544, 542, 543, 540, 541, 541, 545, 0, 548, + 539, 540, 544, 549, 545, 542, 543, 546, 547, 544, + 539, 551, 542, 543, 546, 547, 544, 550, 544, 548, + 595, 0, 553, 549, 545, 554, 548, 546, 556, 544, + 549, 551, 550, 552, 546, 547, 544, 550, 551, 554, + 552, 546, 553, 555, 550, 554, 548, 595, 556, 553, + 549, 0, 554, 552, 546, 556, 555, 558, 551, 550, + 552, 559, 562, 555, 550, 560, 554, 552, 0, 553, + 555, 557, 554, 557, 559, 556, 563, 558, 560, 561, + + 552, 559, 562, 555, 558, 560, 0, 561, 559, 562, + 555, 564, 560, 557, 0, 564, 563, 567, 557, 561, + 557, 559, 0, 563, 558, 560, 561, 565, 559, 562, + 567, 565, 560, 566, 561, 564, 0, 567, 564, 569, + 557, 566, 564, 563, 567, 0, 561, 569, 0, 571, + 568, 565, 572, 566, 565, 574, 0, 567, 565, 569, + 566, 570, 564, 570, 567, 568, 569, 573, 566, 571, + 568, 573, 572, 576, 569, 574, 571, 568, 565, 572, + 566, 575, 574, 570, 0, 0, 569, 573, 570, 577, + 570, 575, 568, 576, 573, 580, 571, 568, 573, 572, + + 576, 575, 574, 577, 578, 0, 578, 0, 575, 577, + 570, 580, 579, 581, 573, 580, 577, 581, 575, 0, + 576, 579, 580, 583, 0, 583, 578, 0, 575, 596, + 577, 578, 579, 578, 582, 584, 577, 581, 580, 579, + 581, 597, 580, 583, 581, 585, 587, 586, 579, 582, + 583, 588, 583, 578, 582, 584, 596, 599, 600, 579, + 601, 582, 584, 586, 581, 585, 587, 586, 597, 603, + 583, 588, 585, 587, 586, 604, 582, 605, 588, 606, + 607, 582, 584, 608, 599, 600, 609, 601, 610, 611, + 586, 613, 585, 587, 586, 614, 603, 615, 588, 618, + + 619, 620, 604, 621, 605, 626, 606, 607, 627, 628, + 608, 631, 632, 609, 633, 610, 611, 634, 613, 635, + 637, 638, 614, 639, 615, 640, 618, 619, 620, 641, + 621, 642, 626, 643, 644, 627, 628, 646, 631, 632, + 647, 633, 648, 650, 634, 651, 635, 637, 638, 0, + 639, 653, 640, 654, 655, 717, 641, 656, 642, 657, + 643, 644, 658, 658, 646, 719, 720, 647, 661, 648, + 650, 653, 651, 654, 655, 655, 659, 656, 653, 657, + 654, 655, 717, 658, 656, 659, 657, 660, 661, 658, + 658, 662, 719, 720, 0, 661, 659, 660, 653, 663, + + 654, 655, 655, 659, 656, 665, 657, 660, 666, 663, + 658, 662, 659, 664, 660, 661, 721, 722, 662, 663, + 664, 668, 667, 659, 660, 665, 663, 0, 666, 0, + 668, 669, 665, 664, 660, 666, 663, 667, 662, 670, + 664, 668, 667, 721, 722, 724, 663, 664, 668, 667, + 671, 669, 665, 673, 675, 666, 672, 668, 669, 670, + 664, 675, 676, 0, 667, 671, 670, 673, 668, 667, + 671, 672, 724, 673, 675, 674, 672, 671, 669, 674, + 673, 675, 676, 672, 0, 677, 670, 677, 675, 676, + 680, 678, 671, 679, 673, 674, 681, 671, 672, 725, + + 673, 675, 674, 672, 678, 677, 674, 0, 679, 676, + 680, 678, 677, 679, 677, 0, 681, 680, 678, 682, + 679, 683, 674, 681, 0, 686, 725, 687, 0, 685, + 684, 678, 677, 688, 682, 679, 685, 680, 678, 682, + 679, 683, 689, 681, 684, 686, 682, 687, 683, 685, + 684, 690, 686, 688, 687, 690, 685, 684, 0, 693, + 688, 682, 689, 685, 691, 728, 682, 691, 683, 689, + 692, 684, 686, 694, 687, 690, 685, 684, 690, 693, + 688, 695, 690, 696, 691, 692, 693, 698, 0, 689, + 692, 691, 728, 694, 691, 699, 696, 692, 0, 699, + + 694, 695, 690, 696, 700, 697, 693, 698, 695, 701, + 696, 691, 692, 701, 698, 699, 732, 692, 697, 734, + 694, 737, 699, 696, 700, 697, 699, 705, 695, 702, + 696, 700, 697, 701, 698, 704, 701, 703, 703, 704, + 701, 705, 699, 732, 702, 697, 734, 705, 737, 702, + 706, 700, 697, 709, 705, 0, 702, 708, 703, 704, + 701, 708, 704, 706, 703, 703, 704, 707, 705, 710, + 706, 702, 0, 709, 705, 712, 702, 706, 711, 711, + 709, 708, 707, 713, 708, 703, 704, 707, 708, 710, + 706, 740, 716, 714, 707, 712, 710, 706, 741, 711, + + 709, 743, 712, 713, 744, 711, 711, 714, 708, 707, + 713, 715, 716, 714, 707, 715, 710, 746, 740, 716, + 714, 747, 712, 748, 750, 741, 711, 751, 743, 754, + 713, 744, 756, 757, 714, 715, 758, 763, 715, 716, + 714, 764, 715, 816, 746, 765, 766, 767, 747, 0, + 748, 750, 0, 0, 751, 766, 754, 768, 770, 756, + 757, 764, 715, 758, 763, 765, 766, 767, 764, 769, + 816, 768, 765, 766, 767, 772, 769, 768, 770, 771, + 773, 771, 766, 0, 768, 770, 0, 0, 764, 769, + 772, 774, 765, 766, 767, 772, 769, 775, 768, 775, + + 773, 771, 772, 769, 768, 770, 771, 773, 771, 776, + 777, 774, 778, 779, 780, 818, 769, 772, 774, 775, + 0, 0, 772, 782, 775, 783, 775, 773, 771, 776, + 777, 784, 778, 779, 780, 781, 776, 777, 774, 778, + 779, 780, 818, 782, 781, 783, 775, 785, 786, 788, + 782, 784, 783, 787, 0, 781, 776, 777, 784, 778, + 779, 780, 781, 789, 823, 825, 787, 785, 786, 788, + 782, 781, 783, 787, 785, 786, 788, 790, 784, 792, + 787, 791, 781, 789, 790, 791, 0, 793, 0, 794, + 789, 823, 825, 787, 785, 786, 788, 790, 795, 792, + + 787, 796, 793, 798, 790, 791, 792, 793, 791, 794, + 789, 790, 791, 797, 793, 797, 794, 798, 795, 799, + 0, 796, 826, 798, 790, 795, 792, 800, 796, 793, + 798, 801, 791, 802, 793, 797, 794, 803, 801, 799, + 797, 803, 797, 0, 798, 795, 799, 800, 796, 826, + 798, 801, 804, 802, 800, 805, 804, 806, 801, 829, + 802, 803, 797, 832, 803, 801, 799, 807, 803, 808, + 805, 809, 833, 834, 800, 805, 804, 806, 801, 804, + 802, 836, 805, 804, 806, 810, 829, 807, 803, 808, + 832, 809, 810, 837, 807, 838, 808, 805, 809, 833, + + 834, 836, 805, 804, 806, 810, 839, 840, 836, 842, + 843, 844, 810, 837, 807, 838, 808, 841, 809, 810, + 837, 841, 838, 845, 0, 843, 839, 840, 836, 842, + 843, 844, 810, 839, 840, 846, 842, 843, 844, 847, + 837, 841, 838, 845, 841, 848, 0, 848, 841, 849, + 845, 850, 843, 839, 840, 846, 842, 843, 844, 847, + 851, 852, 846, 853, 850, 0, 847, 848, 841, 849, + 845, 850, 848, 855, 848, 856, 849, 854, 850, 859, + 851, 852, 846, 853, 0, 860, 847, 851, 852, 861, + 853, 850, 854, 855, 848, 856, 849, 854, 850, 859, + + 855, 857, 856, 858, 854, 860, 859, 851, 852, 863, + 853, 858, 860, 865, 857, 867, 861, 868, 0, 854, + 855, 857, 856, 858, 854, 871, 859, 0, 857, 0, + 858, 870, 860, 873, 872, 875, 863, 876, 858, 0, + 865, 857, 867, 874, 868, 871, 870, 878, 857, 872, + 858, 870, 871, 873, 872, 875, 874, 876, 870, 0, + 873, 872, 875, 874, 876, 879, 877, 878, 881, 884, + 874, 885, 871, 870, 878, 0, 872, 877, 870, 0, + 873, 872, 875, 874, 876, 886, 877, 887, 888, 884, + 874, 885, 879, 877, 878, 881, 884, 891, 885, 886, + + 892, 0, 0, 0, 877, 886, 0, 887, 888, 0, + 0, 0, 886, 877, 887, 888, 884, 891, 885, 0, + 892, 0, 0, 0, 891, 0, 886, 892, 0, 0, + 0, 0, 886, 0, 887, 888, 0, 0, 0, 0, + 0, 0, 0, 0, 891, 0, 0, 892, 894, 0, + 0, 894, 895, 0, 895, 895, 897, 0, 897, 897, + 898, 0, 898, 898, 899, 0, 899, 899, 900, 0, + 900, 900, 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, + + 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893 + } ; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +#line 1 "flex_lexer.l" +/** + * lexer + * + * + */ +/*************************** + ** Section 1: Definitions + ***************************/ +#line 12 "flex_lexer.l" + +#include "../sqltypes.h" +#include "bison_parser.h" +#include + +#define TOKEN(name) { return SQL_##name; } + +/*************************** + ** Section 2: Rules + ***************************/ +/* Define the output files */ +/* Make reentrant */ +/* performance tweeks */ +/* other flags */ +/* %option nodefault */ + +/*************************** + ** Section 3: Rules + ***************************/ +#line 1567 "flex_lexer.cpp" + +#define INITIAL 0 +#define COMMENT 1 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +/* Holds the entire state of the reentrant scanner. */ +struct yyguts_t + { + + /* User-defined. Not touched by flex. */ + YY_EXTRA_TYPE yyextra_r; + + /* The rest are the same as the globals declared in the non-reentrant scanner. */ + FILE *yyin_r, *yyout_r; + size_t yy_buffer_stack_top; /**< index of top of stack. */ + size_t yy_buffer_stack_max; /**< capacity of stack. */ + YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ + char yy_hold_char; + int yy_n_chars; + int yyleng_r; + char *yy_c_buf_p; + int yy_init; + int yy_start; + int yy_did_buffer_switch_on_eof; + int yy_start_stack_ptr; + int yy_start_stack_depth; + int *yy_start_stack; + yy_state_type yy_last_accepting_state; + char* yy_last_accepting_cpos; + + int yylineno_r; + int yy_flex_debug_r; + + char *yytext_r; + int yy_more_flag; + int yy_more_len; + + YYSTYPE * yylval_r; + + YYLTYPE * yylloc_r; + + }; /* end struct yyguts_t */ + +static int yy_init_globals (yyscan_t yyscanner ); + + /* This must go here because YYSTYPE and YYLTYPE are included + * from bison output in section 1.*/ + # define yylval yyg->yylval_r + + # define yylloc yyg->yylloc_r + +int hsql_lex_init (yyscan_t* scanner); + +int hsql_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int hsql_lex_destroy (yyscan_t yyscanner ); + +int hsql_get_debug (yyscan_t yyscanner ); + +void hsql_set_debug (int debug_flag ,yyscan_t yyscanner ); + +YY_EXTRA_TYPE hsql_get_extra (yyscan_t yyscanner ); + +void hsql_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); + +FILE *hsql_get_in (yyscan_t yyscanner ); + +void hsql_set_in (FILE * in_str ,yyscan_t yyscanner ); + +FILE *hsql_get_out (yyscan_t yyscanner ); + +void hsql_set_out (FILE * out_str ,yyscan_t yyscanner ); + +int hsql_get_leng (yyscan_t yyscanner ); + +char *hsql_get_text (yyscan_t yyscanner ); + +int hsql_get_lineno (yyscan_t yyscanner ); + +void hsql_set_lineno (int line_number ,yyscan_t yyscanner ); + +YYSTYPE * hsql_get_lval (yyscan_t yyscanner ); + +void hsql_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); + + YYLTYPE *hsql_get_lloc (yyscan_t yyscanner ); + + void hsql_set_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int hsql_wrap (yyscan_t yyscanner ); +#else +extern int hsql_wrap (yyscan_t yyscanner ); +#endif +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT + +#ifdef __cplusplus +static int yyinput (yyscan_t yyscanner ); +#else +static int input (yyscan_t yyscanner ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + size_t n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int hsql_lex \ + (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner); + +#define YY_DECL int hsql_lex \ + (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + +#line 51 "flex_lexer.l" + + +#line 1815 "flex_lexer.cpp" + + yylval = yylval_param; + + yylloc = yylloc_param; + + if ( !yyg->yy_init ) + { + yyg->yy_init = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yyg->yy_start ) + yyg->yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + hsql_ensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + hsql__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); + } + + hsql__load_buffer_state(yyscanner ); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yyg->yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yyg->yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yyg->yy_start; +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 894 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_current_state != 893 ); + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yyg->yy_hold_char; + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 53 "flex_lexer.l" +BEGIN(COMMENT); + YY_BREAK +case 2: +YY_RULE_SETUP +#line 54 "flex_lexer.l" +/* skipping comment content until a end of line is read */; + YY_BREAK +case 3: +/* rule 3 can match eol */ +YY_RULE_SETUP +#line 55 "flex_lexer.l" +BEGIN(INITIAL); + YY_BREAK +case 4: +/* rule 4 can match eol */ +YY_RULE_SETUP +#line 58 "flex_lexer.l" +/* skip whitespace */; + YY_BREAK +case 5: +YY_RULE_SETUP +#line 62 "flex_lexer.l" +TOKEN(DEALLOCATE) + YY_BREAK +case 6: +YY_RULE_SETUP +#line 63 "flex_lexer.l" +TOKEN(PARAMETERS) + YY_BREAK +case 7: +YY_RULE_SETUP +#line 64 "flex_lexer.l" +TOKEN(INTERSECT) + YY_BREAK +case 8: +YY_RULE_SETUP +#line 65 "flex_lexer.l" +TOKEN(TEMPORARY) + YY_BREAK +case 9: +YY_RULE_SETUP +#line 66 "flex_lexer.l" +TOKEN(TIMESTAMP) + YY_BREAK +case 10: +YY_RULE_SETUP +#line 67 "flex_lexer.l" +TOKEN(DISTINCT) + YY_BREAK +case 11: +YY_RULE_SETUP +#line 68 "flex_lexer.l" +TOKEN(NVARCHAR) + YY_BREAK +case 12: +YY_RULE_SETUP +#line 69 "flex_lexer.l" +TOKEN(RESTRICT) + YY_BREAK +case 13: +YY_RULE_SETUP +#line 70 "flex_lexer.l" +TOKEN(TRUNCATE) + YY_BREAK +case 14: +YY_RULE_SETUP +#line 71 "flex_lexer.l" +TOKEN(ANALYZE) + YY_BREAK +case 15: +YY_RULE_SETUP +#line 72 "flex_lexer.l" +TOKEN(BETWEEN) + YY_BREAK +case 16: +YY_RULE_SETUP +#line 73 "flex_lexer.l" +TOKEN(CASCADE) + YY_BREAK +case 17: +YY_RULE_SETUP +#line 74 "flex_lexer.l" +TOKEN(COLUMNS) + YY_BREAK +case 18: +YY_RULE_SETUP +#line 75 "flex_lexer.l" +TOKEN(CONTROL) + YY_BREAK +case 19: +YY_RULE_SETUP +#line 76 "flex_lexer.l" +TOKEN(DEFAULT) + YY_BREAK +case 20: +YY_RULE_SETUP +#line 77 "flex_lexer.l" +TOKEN(EXECUTE) + YY_BREAK +case 21: +YY_RULE_SETUP +#line 78 "flex_lexer.l" +TOKEN(EXPLAIN) + YY_BREAK +case 22: +YY_RULE_SETUP +#line 79 "flex_lexer.l" +TOKEN(HISTORY) + YY_BREAK +case 23: +YY_RULE_SETUP +#line 80 "flex_lexer.l" +TOKEN(INTEGER) + YY_BREAK +case 24: +YY_RULE_SETUP +#line 81 "flex_lexer.l" +TOKEN(NATURAL) + YY_BREAK +case 25: +YY_RULE_SETUP +#line 82 "flex_lexer.l" +TOKEN(PREPARE) + YY_BREAK +case 26: +YY_RULE_SETUP +#line 83 "flex_lexer.l" +TOKEN(PRIMARY) + YY_BREAK +case 27: +YY_RULE_SETUP +#line 84 "flex_lexer.l" +TOKEN(SCHEMAS) + YY_BREAK +case 28: +YY_RULE_SETUP +#line 85 "flex_lexer.l" +TOKEN(SPATIAL) + YY_BREAK +case 29: +YY_RULE_SETUP +#line 86 "flex_lexer.l" +TOKEN(VIRTUAL) + YY_BREAK +case 30: +YY_RULE_SETUP +#line 87 "flex_lexer.l" +TOKEN(BEFORE) + YY_BREAK +case 31: +YY_RULE_SETUP +#line 88 "flex_lexer.l" +TOKEN(COLUMN) + YY_BREAK +case 32: +YY_RULE_SETUP +#line 89 "flex_lexer.l" +TOKEN(CREATE) + YY_BREAK +case 33: +YY_RULE_SETUP +#line 90 "flex_lexer.l" +TOKEN(DELETE) + YY_BREAK +case 34: +YY_RULE_SETUP +#line 91 "flex_lexer.l" +TOKEN(DIRECT) + YY_BREAK +case 35: +YY_RULE_SETUP +#line 92 "flex_lexer.l" +TOKEN(DOUBLE) + YY_BREAK +case 36: +YY_RULE_SETUP +#line 93 "flex_lexer.l" +TOKEN(ESCAPE) + YY_BREAK +case 37: +YY_RULE_SETUP +#line 94 "flex_lexer.l" +TOKEN(EXCEPT) + YY_BREAK +case 38: +YY_RULE_SETUP +#line 95 "flex_lexer.l" +TOKEN(EXISTS) + YY_BREAK +case 39: +YY_RULE_SETUP +#line 96 "flex_lexer.l" +TOKEN(GLOBAL) + YY_BREAK +case 40: +YY_RULE_SETUP +#line 97 "flex_lexer.l" +TOKEN(HAVING) + YY_BREAK +case 41: +YY_RULE_SETUP +#line 98 "flex_lexer.l" +TOKEN(IMPORT) + YY_BREAK +case 42: +YY_RULE_SETUP +#line 99 "flex_lexer.l" +TOKEN(INSERT) + YY_BREAK +case 43: +YY_RULE_SETUP +#line 100 "flex_lexer.l" +TOKEN(ISNULL) + YY_BREAK +case 44: +YY_RULE_SETUP +#line 101 "flex_lexer.l" +TOKEN(OFFSET) + YY_BREAK +case 45: +YY_RULE_SETUP +#line 102 "flex_lexer.l" +TOKEN(RENAME) + YY_BREAK +case 46: +YY_RULE_SETUP +#line 103 "flex_lexer.l" +TOKEN(SCHEMA) + YY_BREAK +case 47: +YY_RULE_SETUP +#line 104 "flex_lexer.l" +TOKEN(SELECT) + YY_BREAK +case 48: +YY_RULE_SETUP +#line 105 "flex_lexer.l" +TOKEN(SORTED) + YY_BREAK +case 49: +YY_RULE_SETUP +#line 106 "flex_lexer.l" +TOKEN(TABLES) + YY_BREAK +case 50: +YY_RULE_SETUP +#line 107 "flex_lexer.l" +TOKEN(UNIQUE) + YY_BREAK +case 51: +YY_RULE_SETUP +#line 108 "flex_lexer.l" +TOKEN(UNLOAD) + YY_BREAK +case 52: +YY_RULE_SETUP +#line 109 "flex_lexer.l" +TOKEN(UPDATE) + YY_BREAK +case 53: +YY_RULE_SETUP +#line 110 "flex_lexer.l" +TOKEN(VALUES) + YY_BREAK +case 54: +YY_RULE_SETUP +#line 111 "flex_lexer.l" +TOKEN(AFTER) + YY_BREAK +case 55: +YY_RULE_SETUP +#line 112 "flex_lexer.l" +TOKEN(ALTER) + YY_BREAK +case 56: +YY_RULE_SETUP +#line 113 "flex_lexer.l" +TOKEN(CROSS) + YY_BREAK +case 57: +YY_RULE_SETUP +#line 114 "flex_lexer.l" +TOKEN(DELTA) + YY_BREAK +case 58: +YY_RULE_SETUP +#line 115 "flex_lexer.l" +TOKEN(GROUP) + YY_BREAK +case 59: +YY_RULE_SETUP +#line 116 "flex_lexer.l" +TOKEN(INDEX) + YY_BREAK +case 60: +YY_RULE_SETUP +#line 117 "flex_lexer.l" +TOKEN(INNER) + YY_BREAK +case 61: +YY_RULE_SETUP +#line 118 "flex_lexer.l" +TOKEN(LIMIT) + YY_BREAK +case 62: +YY_RULE_SETUP +#line 119 "flex_lexer.l" +TOKEN(LOCAL) + YY_BREAK +case 63: +YY_RULE_SETUP +#line 120 "flex_lexer.l" +TOKEN(MERGE) + YY_BREAK +case 64: +YY_RULE_SETUP +#line 121 "flex_lexer.l" +TOKEN(MINUS) + YY_BREAK +case 65: +YY_RULE_SETUP +#line 122 "flex_lexer.l" +TOKEN(ORDER) + YY_BREAK +case 66: +YY_RULE_SETUP +#line 123 "flex_lexer.l" +TOKEN(OUTER) + YY_BREAK +case 67: +YY_RULE_SETUP +#line 124 "flex_lexer.l" +TOKEN(RIGHT) + YY_BREAK +case 68: +YY_RULE_SETUP +#line 125 "flex_lexer.l" +TOKEN(TABLE) + YY_BREAK +case 69: +YY_RULE_SETUP +#line 126 "flex_lexer.l" +TOKEN(UNION) + YY_BREAK +case 70: +YY_RULE_SETUP +#line 127 "flex_lexer.l" +TOKEN(USING) + YY_BREAK +case 71: +YY_RULE_SETUP +#line 128 "flex_lexer.l" +TOKEN(WHERE) + YY_BREAK +case 72: +YY_RULE_SETUP +#line 129 "flex_lexer.l" +TOKEN(CALL) + YY_BREAK +case 73: +YY_RULE_SETUP +#line 130 "flex_lexer.l" +TOKEN(DATE) + YY_BREAK +case 74: +YY_RULE_SETUP +#line 131 "flex_lexer.l" +TOKEN(DESC) + YY_BREAK +case 75: +YY_RULE_SETUP +#line 132 "flex_lexer.l" +TOKEN(DROP) + YY_BREAK +case 76: +YY_RULE_SETUP +#line 133 "flex_lexer.l" +TOKEN(FILE) + YY_BREAK +case 77: +YY_RULE_SETUP +#line 134 "flex_lexer.l" +TOKEN(FROM) + YY_BREAK +case 78: +YY_RULE_SETUP +#line 135 "flex_lexer.l" +TOKEN(FULL) + YY_BREAK +case 79: +YY_RULE_SETUP +#line 136 "flex_lexer.l" +TOKEN(HASH) + YY_BREAK +case 80: +YY_RULE_SETUP +#line 137 "flex_lexer.l" +TOKEN(HINT) + YY_BREAK +case 81: +YY_RULE_SETUP +#line 138 "flex_lexer.l" +TOKEN(INTO) + YY_BREAK +case 82: +YY_RULE_SETUP +#line 139 "flex_lexer.l" +TOKEN(JOIN) + YY_BREAK +case 83: +YY_RULE_SETUP +#line 140 "flex_lexer.l" +TOKEN(LEFT) + YY_BREAK +case 84: +YY_RULE_SETUP +#line 141 "flex_lexer.l" +TOKEN(LIKE) + YY_BREAK +case 85: +YY_RULE_SETUP +#line 142 "flex_lexer.l" +TOKEN(LOAD) + YY_BREAK +case 86: +YY_RULE_SETUP +#line 143 "flex_lexer.l" +TOKEN(NULL) + YY_BREAK +case 87: +YY_RULE_SETUP +#line 144 "flex_lexer.l" +TOKEN(PART) + YY_BREAK +case 88: +YY_RULE_SETUP +#line 145 "flex_lexer.l" +TOKEN(PLAN) + YY_BREAK +case 89: +YY_RULE_SETUP +#line 146 "flex_lexer.l" +TOKEN(SHOW) + YY_BREAK +case 90: +YY_RULE_SETUP +#line 147 "flex_lexer.l" +TOKEN(TEXT) + YY_BREAK +case 91: +YY_RULE_SETUP +#line 148 "flex_lexer.l" +TOKEN(TIME) + YY_BREAK +case 92: +YY_RULE_SETUP +#line 149 "flex_lexer.l" +TOKEN(VIEW) + YY_BREAK +case 93: +YY_RULE_SETUP +#line 150 "flex_lexer.l" +TOKEN(WITH) + YY_BREAK +case 94: +YY_RULE_SETUP +#line 151 "flex_lexer.l" +TOKEN(ADD) + YY_BREAK +case 95: +YY_RULE_SETUP +#line 152 "flex_lexer.l" +TOKEN(ALL) + YY_BREAK +case 96: +YY_RULE_SETUP +#line 153 "flex_lexer.l" +TOKEN(AND) + YY_BREAK +case 97: +YY_RULE_SETUP +#line 154 "flex_lexer.l" +TOKEN(ASC) + YY_BREAK +case 98: +YY_RULE_SETUP +#line 155 "flex_lexer.l" +TOKEN(CSV) + YY_BREAK +case 99: +YY_RULE_SETUP +#line 156 "flex_lexer.l" +TOKEN(FOR) + YY_BREAK +case 100: +YY_RULE_SETUP +#line 157 "flex_lexer.l" +TOKEN(INT) + YY_BREAK +case 101: +YY_RULE_SETUP +#line 158 "flex_lexer.l" +TOKEN(KEY) + YY_BREAK +case 102: +YY_RULE_SETUP +#line 159 "flex_lexer.l" +TOKEN(NOT) + YY_BREAK +case 103: +YY_RULE_SETUP +#line 160 "flex_lexer.l" +TOKEN(OFF) + YY_BREAK +case 104: +YY_RULE_SETUP +#line 161 "flex_lexer.l" +TOKEN(SET) + YY_BREAK +case 105: +YY_RULE_SETUP +#line 162 "flex_lexer.l" +TOKEN(TBL) + YY_BREAK +case 106: +YY_RULE_SETUP +#line 163 "flex_lexer.l" +TOKEN(TOP) + YY_BREAK +case 107: +YY_RULE_SETUP +#line 164 "flex_lexer.l" +TOKEN(AS) + YY_BREAK +case 108: +YY_RULE_SETUP +#line 165 "flex_lexer.l" +TOKEN(BY) + YY_BREAK +case 109: +YY_RULE_SETUP +#line 166 "flex_lexer.l" +TOKEN(IF) + YY_BREAK +case 110: +YY_RULE_SETUP +#line 167 "flex_lexer.l" +TOKEN(IN) + YY_BREAK +case 111: +YY_RULE_SETUP +#line 168 "flex_lexer.l" +TOKEN(IS) + YY_BREAK +case 112: +YY_RULE_SETUP +#line 169 "flex_lexer.l" +TOKEN(OF) + YY_BREAK +case 113: +YY_RULE_SETUP +#line 170 "flex_lexer.l" +TOKEN(ON) + YY_BREAK +case 114: +YY_RULE_SETUP +#line 171 "flex_lexer.l" +TOKEN(OR) + YY_BREAK +case 115: +YY_RULE_SETUP +#line 172 "flex_lexer.l" +TOKEN(TO) + YY_BREAK +case 116: +YY_RULE_SETUP +#line 175 "flex_lexer.l" +TOKEN(NOTEQUALS) + YY_BREAK +case 117: +YY_RULE_SETUP +#line 176 "flex_lexer.l" +TOKEN(LESSEQ) + YY_BREAK +case 118: +YY_RULE_SETUP +#line 177 "flex_lexer.l" +TOKEN(GREATEREQ) + YY_BREAK +case 119: +YY_RULE_SETUP +#line 180 "flex_lexer.l" +{ return yytext[0]; } + YY_BREAK +case 120: +#line 184 "flex_lexer.l" +case 121: +YY_RULE_SETUP +#line 184 "flex_lexer.l" +{ + yylval->fval = atof(yytext); + return SQL_FLOATVAL; +} + YY_BREAK +case 122: +YY_RULE_SETUP +#line 189 "flex_lexer.l" +{ + yylval->ival = atol(yytext); + return SQL_INTVAL; +} + YY_BREAK +case 123: +YY_RULE_SETUP +#line 194 "flex_lexer.l" +{ + // Crop the leading and trailing quote char + yylval->sval = hsql::substr(yytext, 1, strlen(yytext)-1); + return SQL_IDENTIFIER; +} + YY_BREAK +case 124: +YY_RULE_SETUP +#line 200 "flex_lexer.l" +{ + yylval->sval = strdup(yytext); + return SQL_IDENTIFIER; +} + YY_BREAK +case 125: +YY_RULE_SETUP +#line 206 "flex_lexer.l" +{ + // Crop the leading and trailing quote char + yylval->sval = hsql::substr(yytext, 1, strlen(yytext)-1); + return SQL_STRING; +} + YY_BREAK +case 126: +YY_RULE_SETUP +#line 212 "flex_lexer.l" +{ fprintf(stderr, "[SQL-Lexer-Error] Unknown Character: %c\n", yytext[0]); return 0; } + YY_BREAK +case 127: +YY_RULE_SETUP +#line 215 "flex_lexer.l" +ECHO; + YY_BREAK +#line 2549 "flex_lexer.cpp" +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(COMMENT): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yyg->yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * hsql_lex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); + + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yyg->yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_END_OF_FILE: + { + yyg->yy_did_buffer_switch_on_eof = 0; + + if ( hsql_wrap(yyscanner ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = + yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yyg->yy_c_buf_p = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ +} /* end of hsql_lex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = yyg->yytext_ptr; + register int number_to_move, i; + int ret_val; + + if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + + int yy_c_buf_p_offset = + (int) (yyg->yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + hsql_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + yyg->yy_n_chars, (size_t) num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + if ( yyg->yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + hsql_restart(yyin ,yyscanner); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) hsql_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + + yyg->yy_n_chars += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (yyscan_t yyscanner) +{ + register yy_state_type yy_current_state; + register char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_current_state = yyg->yy_start; + + for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 894 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) +{ + register int yy_is_jam; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ + register char *yy_cp = yyg->yy_c_buf_p; + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 894 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 893); + + return yy_is_jam ? 0 : yy_current_state; +} + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (yyscan_t yyscanner) +#else + static int input (yyscan_t yyscanner) +#endif + +{ + int c; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + *yyg->yy_c_buf_p = yyg->yy_hold_char; + + if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + /* This was really a NUL. */ + *yyg->yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; + ++yyg->yy_c_buf_p; + + switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + hsql_restart(yyin ,yyscanner); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( hsql_wrap(yyscanner ) ) + return EOF; + + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(yyscanner); +#else + return input(yyscanner); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = yyg->yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ + *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ + yyg->yy_hold_char = *++yyg->yy_c_buf_p; + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * @param yyscanner The scanner object. + * @note This function does not reset the start condition to @c INITIAL . + */ + void hsql_restart (FILE * input_file , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! YY_CURRENT_BUFFER ){ + hsql_ensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + hsql__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); + } + + hsql__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); + hsql__load_buffer_state(yyscanner ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * @param yyscanner The scanner object. + */ + void hsql__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* TODO. We should be able to replace this entire function body + * with + * hsql_pop_buffer_state(); + * hsql_push_buffer_state(new_buffer); + */ + hsql_ensure_buffer_stack (yyscanner); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + hsql__load_buffer_state(yyscanner ); + + /* We don't actually know whether we did this switch during + * EOF (hsql_wrap()) processing, but the only time this flag + * is looked at is after hsql_wrap() is called, so it's safe + * to go ahead and always set it. + */ + yyg->yy_did_buffer_switch_on_eof = 1; +} + +static void hsql__load_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + yyg->yy_hold_char = *yyg->yy_c_buf_p; +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * @param yyscanner The scanner object. + * @return the allocated buffer state. + */ + YY_BUFFER_STATE hsql__create_buffer (FILE * file, int size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) hsql_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in hsql__create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) hsql_alloc(b->yy_buf_size + 2 ,yyscanner ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in hsql__create_buffer()" ); + + b->yy_is_our_buffer = 1; + + hsql__init_buffer(b,file ,yyscanner); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with hsql__create_buffer() + * @param yyscanner The scanner object. + */ + void hsql__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + hsql_free((void *) b->yy_ch_buf ,yyscanner ); + + hsql_free((void *) b ,yyscanner ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a hsql_restart() or at EOF. + */ + static void hsql__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) + +{ + int oerrno = errno; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + hsql__flush_buffer(b ,yyscanner); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then hsql__init_buffer was _probably_ + * called from hsql_restart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * @param yyscanner The scanner object. + */ + void hsql__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + hsql__load_buffer_state(yyscanner ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * @param yyscanner The scanner object. + */ +void hsql_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (new_buffer == NULL) + return; + + hsql_ensure_buffer_stack(yyscanner); + + /* This block is copied from hsql__switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + yyg->yy_buffer_stack_top++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from hsql__switch_to_buffer. */ + hsql__load_buffer_state(yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * @param yyscanner The scanner object. + */ +void hsql_pop_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (!YY_CURRENT_BUFFER) + return; + + hsql__delete_buffer(YY_CURRENT_BUFFER ,yyscanner); + YY_CURRENT_BUFFER_LVALUE = NULL; + if (yyg->yy_buffer_stack_top > 0) + --yyg->yy_buffer_stack_top; + + if (YY_CURRENT_BUFFER) { + hsql__load_buffer_state(yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void hsql_ensure_buffer_stack (yyscan_t yyscanner) +{ + int num_to_alloc; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (!yyg->yy_buffer_stack) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; + yyg->yy_buffer_stack = (struct yy_buffer_state**)hsql_alloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in hsql_ensure_buffer_stack()" ); + + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + yyg->yy_buffer_stack_max = num_to_alloc; + yyg->yy_buffer_stack_top = 0; + return; + } + + if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = yyg->yy_buffer_stack_max + grow_size; + yyg->yy_buffer_stack = (struct yy_buffer_state**)hsql_realloc + (yyg->yy_buffer_stack, + num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in hsql_ensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); + yyg->yy_buffer_stack_max = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE hsql__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) hsql_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in hsql__scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + hsql__switch_to_buffer(b ,yyscanner ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to hsql_lex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * hsql__scan_bytes() instead. + */ +YY_BUFFER_STATE hsql__scan_string (yyconst char * yystr , yyscan_t yyscanner) +{ + + return hsql__scan_bytes(yystr,strlen(yystr) ,yyscanner); +} + +/** Setup the input buffer state to scan the given bytes. The next call to hsql_lex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE hsql__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = _yybytes_len + 2; + buf = (char *) hsql_alloc(n ,yyscanner ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in hsql__scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = hsql__scan_buffer(buf,n ,yyscanner); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in hsql__scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) +{ + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = yyg->yy_hold_char; \ + yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ + yyg->yy_hold_char = *yyg->yy_c_buf_p; \ + *yyg->yy_c_buf_p = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the user-defined data for this scanner. + * @param yyscanner The scanner object. + */ +YY_EXTRA_TYPE hsql_get_extra (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyextra; +} + +/** Get the current line number. + * @param yyscanner The scanner object. + */ +int hsql_get_lineno (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yylineno; +} + +/** Get the current column number. + * @param yyscanner The scanner object. + */ +int hsql_get_column (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yycolumn; +} + +/** Get the input stream. + * @param yyscanner The scanner object. + */ +FILE *hsql_get_in (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyin; +} + +/** Get the output stream. + * @param yyscanner The scanner object. + */ +FILE *hsql_get_out (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyout; +} + +/** Get the length of the current token. + * @param yyscanner The scanner object. + */ +int hsql_get_leng (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyleng; +} + +/** Get the current token. + * @param yyscanner The scanner object. + */ + +char *hsql_get_text (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yytext; +} + +/** Set the user-defined data. This data is never touched by the scanner. + * @param user_defined The data to be associated with this scanner. + * @param yyscanner The scanner object. + */ +void hsql_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyextra = user_defined ; +} + +/** Set the current line number. + * @param line_number + * @param yyscanner The scanner object. + */ +void hsql_set_lineno (int line_number , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* lineno is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + yy_fatal_error( "hsql_set_lineno called with no buffer" , yyscanner); + + yylineno = line_number; +} + +/** Set the current column. + * @param line_number + * @param yyscanner The scanner object. + */ +void hsql_set_column (int column_no , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* column is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + yy_fatal_error( "hsql_set_column called with no buffer" , yyscanner); + + yycolumn = column_no; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param in_str A readable stream. + * @param yyscanner The scanner object. + * @see hsql__switch_to_buffer + */ +void hsql_set_in (FILE * in_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyin = in_str ; +} + +void hsql_set_out (FILE * out_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyout = out_str ; +} + +int hsql_get_debug (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yy_flex_debug; +} + +void hsql_set_debug (int bdebug , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_flex_debug = bdebug ; +} + +/* Accessor methods for yylval and yylloc */ + +YYSTYPE * hsql_get_lval (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yylval; +} + +void hsql_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yylval = yylval_param; +} + +YYLTYPE *hsql_get_lloc (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yylloc; +} + +void hsql_set_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yylloc = yylloc_param; +} + +/* User-visible API */ + +/* hsql_lex_init is special because it creates the scanner itself, so it is + * the ONLY reentrant function that doesn't take the scanner as the last argument. + * That's why we explicitly handle the declaration, instead of using our macros. + */ + +int hsql_lex_init(yyscan_t* ptr_yy_globals) + +{ + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) hsql_alloc ( sizeof( struct yyguts_t ), NULL ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + return yy_init_globals ( *ptr_yy_globals ); +} + +/* hsql_lex_init_extra has the same functionality as hsql_lex_init, but follows the + * convention of taking the scanner as the last argument. Note however, that + * this is a *pointer* to a scanner, as it will be allocated by this call (and + * is the reason, too, why this function also must handle its own declaration). + * The user defined value in the first argument will be available to hsql_alloc in + * the yyextra field. + */ + +int hsql_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) + +{ + struct yyguts_t dummy_yyguts; + + hsql_set_extra (yy_user_defined, &dummy_yyguts); + + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) hsql_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in + yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + hsql_set_extra (yy_user_defined, *ptr_yy_globals); + + return yy_init_globals ( *ptr_yy_globals ); +} + +static int yy_init_globals (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from hsql_lex_destroy(), so don't allocate here. + */ + + yyg->yy_buffer_stack = 0; + yyg->yy_buffer_stack_top = 0; + yyg->yy_buffer_stack_max = 0; + yyg->yy_c_buf_p = (char *) 0; + yyg->yy_init = 0; + yyg->yy_start = 0; + + yyg->yy_start_stack_ptr = 0; + yyg->yy_start_stack_depth = 0; + yyg->yy_start_stack = NULL; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = (FILE *) 0; + yyout = (FILE *) 0; +#endif + + /* For future reference: Set errno on error, since we are called by + * hsql_lex_init() + */ + return 0; +} + +/* hsql_lex_destroy is for both reentrant and non-reentrant scanners. */ +int hsql_lex_destroy (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + hsql__delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); + YY_CURRENT_BUFFER_LVALUE = NULL; + hsql_pop_buffer_state(yyscanner); + } + + /* Destroy the stack itself. */ + hsql_free(yyg->yy_buffer_stack ,yyscanner); + yyg->yy_buffer_stack = NULL; + + /* Destroy the start condition stack. */ + hsql_free(yyg->yy_start_stack ,yyscanner ); + yyg->yy_start_stack = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * hsql_lex() is called, initialization will occur. */ + yy_init_globals( yyscanner); + + /* Destroy the main struct (reentrant only). */ + hsql_free ( yyscanner , yyscanner ); + yyscanner = NULL; + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) +{ + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) +{ + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *hsql_alloc (yy_size_t size , yyscan_t yyscanner) +{ + return (void *) malloc( size ); +} + +void *hsql_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner) +{ + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); +} + +void hsql_free (void * ptr , yyscan_t yyscanner) +{ + free( (char *) ptr ); /* see hsql_realloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 215 "flex_lexer.l" + + +/*************************** + ** Section 3: User code + ***************************/ + +int yyerror(const char *msg) { + fprintf(stderr, "[SQL-Lexer-Error] %s\n",msg); return 0; +} diff --git a/src/parser/flex_lexer.h b/src/parser/flex_lexer.h new file mode 100644 index 0000000..c91a10a --- /dev/null +++ b/src/parser/flex_lexer.h @@ -0,0 +1,360 @@ +#ifndef hsql_HEADER_H +#define hsql_HEADER_H 1 +#define hsql_IN_HEADER 1 + +#line 6 "flex_lexer.h" + +#line 8 "flex_lexer.h" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 35 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +void hsql_restart (FILE *input_file ,yyscan_t yyscanner ); +void hsql__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); +YY_BUFFER_STATE hsql__create_buffer (FILE *file,int size ,yyscan_t yyscanner ); +void hsql__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); +void hsql__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); +void hsql_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); +void hsql_pop_buffer_state (yyscan_t yyscanner ); + +YY_BUFFER_STATE hsql__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); +YY_BUFFER_STATE hsql__scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); +YY_BUFFER_STATE hsql__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); + +void *hsql_alloc (yy_size_t ,yyscan_t yyscanner ); +void *hsql_realloc (void *,yy_size_t ,yyscan_t yyscanner ); +void hsql_free (void * ,yyscan_t yyscanner ); + +/* Begin user sect3 */ + +#define hsql_wrap(n) 1 +#define YY_SKIP_YYWRAP + +#define yytext_ptr yytext_r + +#ifdef YY_HEADER_EXPORT_START_CONDITIONS +#define INITIAL 0 +#define COMMENT 1 + +#endif + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +int hsql_lex_init (yyscan_t* scanner); + +int hsql_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int hsql_lex_destroy (yyscan_t yyscanner ); + +int hsql_get_debug (yyscan_t yyscanner ); + +void hsql_set_debug (int debug_flag ,yyscan_t yyscanner ); + +YY_EXTRA_TYPE hsql_get_extra (yyscan_t yyscanner ); + +void hsql_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); + +FILE *hsql_get_in (yyscan_t yyscanner ); + +void hsql_set_in (FILE * in_str ,yyscan_t yyscanner ); + +FILE *hsql_get_out (yyscan_t yyscanner ); + +void hsql_set_out (FILE * out_str ,yyscan_t yyscanner ); + +int hsql_get_leng (yyscan_t yyscanner ); + +char *hsql_get_text (yyscan_t yyscanner ); + +int hsql_get_lineno (yyscan_t yyscanner ); + +void hsql_set_lineno (int line_number ,yyscan_t yyscanner ); + +YYSTYPE * hsql_get_lval (yyscan_t yyscanner ); + +void hsql_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); + + YYLTYPE *hsql_get_lloc (yyscan_t yyscanner ); + + void hsql_set_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int hsql_wrap (yyscan_t yyscanner ); +#else +extern int hsql_wrap (yyscan_t yyscanner ); +#endif +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int hsql_lex \ + (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner); + +#define YY_DECL int hsql_lex \ + (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +#undef YY_NEW_FILE +#undef YY_FLUSH_BUFFER +#undef yy_set_bol +#undef yy_new_buffer +#undef yy_set_interactive +#undef YY_DO_BEFORE_ACTION + +#ifdef YY_DECL_IS_OURS +#undef YY_DECL_IS_OURS +#undef YY_DECL +#endif + +#line 215 "flex_lexer.l" + + +#line 359 "flex_lexer.h" +#undef hsql_IN_HEADER +#endif /* hsql_HEADER_H */