diff --git a/.gitignore b/.gitignore index 59c419d..d47c92e 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,6 @@ cmake-build-debug/ *.swp *.csv + +# macOS compilation dirs +*.dSYM diff --git a/src/parser/bison_parser.cpp b/src/parser/bison_parser.cpp index 63fc7a9..4c1a629 100644 --- a/src/parser/bison_parser.cpp +++ b/src/parser/bison_parser.cpp @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.0.4. */ +/* A Bison parser, made by GNU Bison 3.0.2. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. + 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 @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.0.4" +#define YYBISON_VERSION "3.0.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -303,7 +303,7 @@ extern int hsql_debug; /* Value type. */ #if ! defined HSQL_STYPE && ! defined HSQL_STYPE_IS_DECLARED - +typedef union HSQL_STYPE HSQL_STYPE; union HSQL_STYPE { #line 93 "bison_parser.y" /* yacc.c:355 */ @@ -324,6 +324,7 @@ union HSQL_STYPE hsql::DropStatement* drop_stmt; hsql::PrepareStatement* prep_stmt; hsql::ExecuteStatement* exec_stmt; + hsql::ShowStatement* show_stmt; hsql::TableRef* table; hsql::Expr* expr; @@ -343,10 +344,8 @@ union HSQL_STYPE std::vector* expr_vec; std::vector* order_vec; -#line 347 "bison_parser.cpp" /* yacc.c:355 */ +#line 348 "bison_parser.cpp" /* yacc.c:355 */ }; - -typedef union HSQL_STYPE HSQL_STYPE; # define HSQL_STYPE_IS_TRIVIAL 1 # define HSQL_STYPE_IS_DECLARED 1 #endif @@ -373,7 +372,7 @@ int hsql_parse (hsql::SQLParserResult* result, yyscan_t scanner); /* Copy the second part of user declarations. */ -#line 377 "bison_parser.cpp" /* yacc.c:358 */ +#line 376 "bison_parser.cpp" /* yacc.c:358 */ #ifdef short # undef short @@ -615,18 +614,18 @@ union yyalloc #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 48 +#define YYFINAL 52 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 559 +#define YYLAST 530 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 151 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 85 +#define YYNNTS 86 /* YYNRULES -- Number of rules. */ -#define YYNRULES 196 +#define YYNRULES 199 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 362 +#define YYNSTATES 367 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ @@ -685,26 +684,26 @@ static const yytype_uint8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 240, 240, 261, 262, 266, 270, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 295, 296, 301, 302, - 306, 310, 322, 329, 332, 336, 348, 356, 360, 370, - 376, 382, 392, 393, 397, 398, 402, 409, 410, 411, - 412, 422, 426, 430, 442, 450, 462, 468, 478, 479, - 489, 498, 499, 503, 515, 516, 517, 534, 535, 539, - 540, 544, 554, 571, 575, 576, 577, 581, 582, 586, - 598, 599, 603, 607, 612, 613, 617, 622, 626, 627, - 630, 631, 635, 636, 640, 644, 645, 646, 652, 653, - 657, 658, 659, 666, 667, 671, 672, 676, 683, 684, - 685, 686, 687, 691, 692, 693, 694, 695, 696, 697, - 698, 699, 703, 704, 708, 709, 710, 711, 712, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 730, 731, 735, 736, 737, 738, 743, 745, 749, 750, - 754, 755, 756, 757, 758, 759, 763, 764, 768, 772, - 776, 780, 781, 782, 783, 787, 788, 789, 790, 794, - 799, 800, 804, 808, 812, 824, 825, 835, 836, 840, - 841, 850, 851, 856, 866, 874, 875, 880, 881, 885, - 886, 894, 902, 912, 931, 932, 933, 934, 935, 936, - 937, 938, 943, 952, 953, 958, 959 + 0, 242, 242, 263, 264, 268, 272, 276, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 300, 301, 306, + 307, 311, 315, 327, 334, 337, 341, 353, 361, 365, + 375, 378, 391, 397, 403, 413, 414, 418, 419, 423, + 430, 431, 432, 433, 443, 447, 451, 463, 471, 483, + 489, 499, 500, 510, 519, 520, 524, 536, 537, 538, + 555, 556, 560, 561, 565, 575, 592, 596, 597, 598, + 602, 603, 607, 619, 620, 624, 628, 633, 634, 638, + 643, 647, 648, 651, 652, 656, 657, 661, 665, 666, + 667, 673, 674, 678, 679, 680, 687, 688, 692, 693, + 697, 704, 705, 706, 707, 708, 712, 713, 714, 715, + 716, 717, 718, 719, 720, 724, 725, 729, 730, 731, + 732, 733, 737, 738, 739, 740, 741, 742, 743, 744, + 745, 746, 747, 751, 752, 756, 757, 758, 759, 764, + 766, 770, 771, 775, 776, 777, 778, 779, 780, 784, + 785, 789, 793, 797, 801, 802, 803, 804, 808, 809, + 810, 811, 815, 820, 821, 825, 829, 833, 845, 846, + 856, 857, 861, 862, 871, 872, 877, 887, 895, 896, + 901, 902, 906, 907, 915, 923, 933, 952, 953, 954, + 955, 956, 957, 958, 959, 964, 973, 974, 979, 980 }; #endif @@ -735,25 +734,25 @@ static const char *const yytname[] = "'.'", "';'", "','", "'?'", "$accept", "input", "statement_list", "statement", "preparable_statement", "opt_hints", "hint_list", "hint", "prepare_statement", "prepare_target_query", "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_paren_or_clause", "select_no_paren", - "set_operator", "set_type", "opt_all", "select_clause", "opt_distinct", - "select_list", "from_clause", "opt_where", "opt_group", "opt_having", - "opt_order", "order_list", "order_desc", "opt_order_type", "opt_top", - "opt_limit", "expr_list", "literal_list", "expr_alias", "expr", - "operand", "scalar_expr", "unary_expr", "binary_expr", "logic_expr", - "in_expr", "case_expr", "exists_expr", "comp_expr", "function_expr", - "array_expr", "array_index", "between_expr", "column_name", "literal", - "string_literal", "num_literal", "int_literal", "null_literal", - "param_expr", "table_ref", "table_ref_atomic", - "nonjoin_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_condition", "opt_semicolon", - "ident_commalist", YY_NULLPTR + "import_statement", "import_file_type", "file_path", "show_statement", + "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_paren_or_clause", + "select_no_paren", "set_operator", "set_type", "opt_all", + "select_clause", "opt_distinct", "select_list", "from_clause", + "opt_where", "opt_group", "opt_having", "opt_order", "order_list", + "order_desc", "opt_order_type", "opt_top", "opt_limit", "expr_list", + "literal_list", "expr_alias", "expr", "operand", "scalar_expr", + "unary_expr", "binary_expr", "logic_expr", "in_expr", "case_expr", + "exists_expr", "comp_expr", "function_expr", "array_expr", "array_index", + "between_expr", "column_name", "literal", "string_literal", + "num_literal", "int_literal", "null_literal", "param_expr", "table_ref", + "table_ref_atomic", "nonjoin_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_condition", + "opt_semicolon", "ident_commalist", YY_NULLPTR }; #endif @@ -781,57 +780,57 @@ static const yytype_uint16 yytoknum[] = }; # endif -#define YYPACT_NINF -259 +#define YYPACT_NINF -232 #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-259))) + (!!((Yystate) == (-232))) -#define YYTABLE_NINF -192 +#define YYTABLE_NINF -195 #define yytable_value_is_error(Yytable_value) \ - (!!((Yytable_value) == (-192))) + (!!((Yytable_value) == (-195))) /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int16 yypact[] = { - 8, 44, 76, 85, 86, 68, 19, 28, 14, 26, - 76, 90, -8, 140, 33, -259, 63, 63, -259, -259, - -259, -259, -259, -259, -259, -259, -259, 37, -259, 132, - 186, 43, -259, 51, 120, 92, 92, 76, 98, 76, - 212, 210, 113, -259, 76, 76, 87, 89, -259, 8, - -259, 150, -259, -259, -259, -259, -259, -8, 148, 126, - -8, 187, -259, 248, 7, 252, 161, 76, 76, 202, - -259, 196, 135, -259, -259, -259, 123, 274, -259, -259, - -259, -259, -259, 136, -259, 215, -259, -259, -259, 123, - 215, 212, -259, -259, -259, -259, -259, -259, 31, -259, - -259, -259, -259, -259, -259, -259, -259, 245, -64, 135, - 123, -259, 284, 286, 127, 50, 145, 206, 129, 168, - 146, -259, 55, 232, 166, -259, 52, 169, -259, -259, - -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, - -259, -259, 190, -48, -259, 314, 187, 170, -259, -49, - 187, 275, -259, 7, -259, 208, 321, 211, -39, 241, - -259, -259, 39, 182, -259, 12, 5, 279, 123, 184, - 146, 328, 123, 88, 189, -71, 3, 202, 123, -259, - 123, 327, 123, -259, -259, 146, -259, 146, -69, 188, - -3, 146, 146, 146, 146, 146, 146, 146, 146, 146, - 146, 146, 146, 146, 146, 212, 7, 274, -259, 191, - 45, -259, -259, 123, -259, -259, -259, -259, 212, -259, - 264, -11, 60, -259, -8, 76, -259, 329, 7, -259, - 123, -259, -259, 199, -18, 279, 260, -117, -259, -259, - -8, -259, 185, -259, -259, 17, -259, 298, -259, -259, - -259, 258, 269, 356, 146, 216, 55, -259, 272, 220, - 356, 356, 356, 382, 382, 382, 382, 88, 88, 18, - 18, 18, 32, 223, -259, -259, 7, -259, 314, -259, - -259, 284, -259, -259, -259, -259, -259, -259, 321, -259, - -259, -259, 61, 71, -259, 146, 218, -259, 222, 288, - -259, -259, -259, 302, 304, 3, 289, -259, 261, -259, - 146, 356, 55, 231, 91, -259, -259, 93, -259, -259, - -259, -259, -259, 213, -259, 17, 3, -259, -259, 472, - 230, 3, 123, 328, 234, 99, -259, -259, -259, 146, - -259, -259, -259, 3, 297, -13, -259, -259, 295, 472, - 236, 123, 123, -259, -259, 6, -39, -259, -39, 235, - 239, -259 + 10, 22, 66, 74, 86, -41, 23, 32, 20, -23, + 66, 95, 19, -34, 153, -36, -232, 65, 65, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, 24, + -232, 157, 174, 63, -232, 68, 142, 118, 118, 66, + 134, 66, 238, 234, 143, -232, 66, 66, 66, -232, + 109, 114, -232, 10, -232, 184, -232, -232, -232, -232, + -232, -34, 160, 158, -34, 209, -232, 282, 7, 286, + 188, 66, 66, 229, -232, 223, 175, -232, -232, -232, + 81, 303, -232, -232, -232, -232, -232, -232, 176, -232, + 252, -232, -232, -232, 81, 252, 238, -232, -232, -232, + -232, -232, -232, 76, -232, -232, -232, -232, -232, -232, + -232, -232, 291, -63, 175, 81, -232, 331, 339, 156, + 31, 199, 248, 112, 204, 177, -232, 70, 267, 201, + -232, 49, 200, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, 226, -49, -232, + 348, 209, 205, -232, -42, 209, 309, -232, 7, -232, + 245, 353, 246, -1, 273, -232, -232, 107, 214, -232, + 4, 5, 312, 81, 218, 177, 359, 81, 60, 219, + -79, 3, 229, 81, -232, 81, 361, 81, -232, -232, + 177, -232, 177, -67, 221, 64, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 238, 7, 303, -232, 222, 120, -232, -232, 81, -232, + -232, -232, -232, 238, -232, 295, -11, 146, -232, -34, + 66, -232, 373, 7, -232, 81, -232, -232, 233, 67, + 312, 298, 92, -232, -232, -34, -232, 40, -232, -232, + 28, -232, 329, -232, -232, -232, 288, 300, 387, 177, + 247, 70, -232, 301, 250, 387, 387, 387, 141, 141, + 141, 141, 60, 60, 71, 71, 71, 51, 251, -232, + -232, 7, -232, 348, -232, -232, 331, -232, -232, -232, + -232, -232, -232, 353, -232, -232, -232, 150, 152, -232, + 177, 253, -232, 254, 308, -232, -232, -232, 328, 330, + 3, 311, -232, 290, -232, 177, 387, 70, 255, 159, + -232, -232, 161, -232, -232, -232, -232, -232, 244, -232, + 28, 3, -232, -232, 225, 257, 3, 81, 359, 261, + 167, -232, -232, -232, 177, -232, -232, -232, 3, 171, + 9, -232, -232, 326, 225, 258, 81, 81, -232, -232, + 6, -1, -232, -1, 263, 262, -232 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -839,71 +838,71 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, - 0, 0, 0, 0, 194, 3, 17, 17, 15, 8, - 9, 14, 11, 12, 10, 13, 7, 54, 55, 81, - 0, 175, 45, 24, 0, 33, 33, 0, 0, 0, - 0, 71, 0, 174, 0, 0, 0, 0, 1, 193, - 2, 0, 6, 5, 65, 66, 64, 0, 68, 0, - 0, 92, 43, 0, 0, 0, 0, 0, 0, 75, - 27, 0, 49, 162, 88, 70, 0, 0, 41, 42, - 58, 57, 4, 0, 59, 81, 60, 67, 63, 0, - 81, 0, 61, 176, 159, 160, 163, 164, 0, 95, - 155, 156, 161, 157, 158, 23, 22, 0, 0, 49, - 0, 44, 0, 0, 0, 151, 0, 0, 0, 0, - 0, 153, 0, 0, 72, 93, 180, 98, 105, 106, - 107, 100, 102, 108, 101, 119, 109, 110, 104, 99, - 112, 113, 0, 75, 51, 0, 92, 80, 82, 87, - 92, 90, 25, 0, 32, 0, 0, 0, 74, 0, - 28, 195, 0, 0, 47, 71, 0, 0, 0, 0, - 0, 115, 0, 114, 0, 0, 0, 75, 0, 178, - 0, 0, 0, 179, 97, 0, 116, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, + 0, 0, 0, 0, 0, 197, 3, 18, 18, 16, + 9, 7, 10, 15, 12, 13, 11, 14, 8, 57, + 58, 84, 0, 178, 48, 25, 0, 36, 36, 0, + 0, 0, 0, 74, 0, 177, 0, 0, 0, 30, + 0, 0, 1, 196, 2, 0, 6, 5, 68, 69, + 67, 0, 71, 0, 0, 95, 46, 0, 0, 0, + 0, 0, 0, 78, 28, 0, 52, 165, 91, 73, + 0, 0, 44, 45, 31, 61, 60, 4, 0, 62, + 84, 63, 70, 66, 0, 84, 0, 64, 179, 162, + 163, 166, 167, 0, 98, 158, 159, 164, 160, 161, + 24, 23, 0, 0, 52, 0, 47, 0, 0, 0, + 154, 0, 0, 0, 0, 0, 156, 0, 0, 75, + 96, 183, 101, 108, 109, 110, 103, 105, 111, 104, + 122, 112, 113, 107, 102, 115, 116, 0, 78, 54, + 0, 95, 83, 85, 90, 95, 93, 26, 0, 35, + 0, 0, 0, 77, 0, 29, 198, 0, 0, 50, + 74, 0, 0, 0, 0, 0, 118, 0, 117, 0, + 0, 0, 78, 0, 181, 0, 0, 0, 182, 100, + 0, 119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 50, 20, - 0, 18, 56, 0, 86, 85, 84, 62, 0, 96, - 0, 0, 0, 34, 0, 0, 48, 0, 0, 146, - 0, 152, 154, 0, 0, 0, 0, 0, 111, 103, - 0, 73, 165, 167, 169, 180, 168, 77, 94, 130, - 177, 131, 0, 126, 0, 0, 0, 117, 0, 129, - 128, 140, 141, 142, 143, 144, 145, 121, 120, 123, - 122, 124, 125, 0, 53, 52, 0, 16, 0, 83, - 91, 0, 38, 39, 40, 37, 36, 30, 0, 31, - 26, 196, 0, 0, 138, 0, 0, 148, 0, 0, - 190, 184, 185, 189, 188, 0, 0, 173, 0, 69, - 0, 127, 0, 0, 0, 118, 149, 0, 19, 29, - 35, 46, 147, 0, 139, 180, 0, 187, 186, 171, - 166, 0, 0, 150, 0, 0, 134, 132, 21, 0, - 136, 170, 181, 0, 191, 79, 135, 133, 0, 172, - 0, 0, 0, 76, 137, 0, 192, 182, 78, 151, - 0, 183 + 0, 0, 0, 53, 21, 0, 19, 59, 0, 89, + 88, 87, 65, 0, 99, 0, 0, 0, 37, 0, + 0, 51, 0, 0, 149, 0, 155, 157, 0, 0, + 0, 0, 0, 114, 106, 0, 76, 168, 170, 172, + 183, 171, 80, 97, 133, 180, 134, 0, 129, 0, + 0, 0, 120, 0, 132, 131, 143, 144, 145, 146, + 147, 148, 124, 123, 126, 125, 127, 128, 0, 56, + 55, 0, 17, 0, 86, 94, 0, 41, 42, 43, + 40, 39, 33, 0, 34, 27, 199, 0, 0, 141, + 0, 0, 151, 0, 0, 193, 187, 188, 192, 191, + 0, 0, 176, 0, 72, 0, 130, 0, 0, 0, + 121, 152, 0, 20, 32, 38, 49, 150, 0, 142, + 183, 0, 190, 189, 174, 169, 0, 0, 153, 0, + 0, 137, 135, 22, 0, 139, 173, 184, 0, 194, + 82, 138, 136, 0, 175, 0, 0, 0, 79, 140, + 0, 195, 185, 81, 154, 0, 186 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -259, -259, -259, 337, -259, 371, -259, 111, -259, -259, - -259, -259, -259, 109, -259, 355, -259, 104, -259, -259, - -259, -259, -259, 287, -259, -259, 204, -191, 9, 354, - -12, 386, -259, -259, 205, 253, -259, -259, -107, -259, - -259, 94, -259, 209, -259, -259, -72, -165, -212, 262, - -88, -80, -259, -259, -259, -259, -259, -259, -259, -259, - -259, -259, -259, -259, 75, -60, -109, -259, -35, -259, - -259, -259, -258, 100, -259, -259, -259, 0, -259, -227, - -259, -259, -259, -259, -259 + -232, -232, -232, 358, -232, 394, -232, 130, -232, -232, + -232, -232, -232, 129, -232, -232, 378, -232, 124, -232, + -232, -232, -232, -232, 305, -232, -232, 208, -202, 17, + 357, -13, 391, -232, -232, 145, 272, -232, -232, -120, + -232, -232, 147, -232, 227, -232, -232, -115, -170, -213, + 240, -93, -68, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, 88, -65, -112, -232, -38, + -232, -232, -232, -187, 96, -232, -232, -232, 0, -232, + -231, -232, -232, -232, -232, -232 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 13, 14, 15, 16, 52, 210, 211, 17, 106, - 18, 19, 71, 159, 20, 67, 222, 223, 286, 21, - 22, 23, 24, 114, 25, 143, 144, 26, 27, 85, - 28, 57, 58, 88, 29, 76, 123, 177, 111, 309, - 353, 61, 147, 148, 216, 41, 92, 124, 98, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 100, 101, 102, 103, - 104, 241, 242, 243, 330, 244, 42, 245, 183, 184, - 246, 306, 357, 50, 162 + -1, 14, 15, 16, 17, 56, 215, 216, 18, 111, + 19, 20, 75, 164, 21, 22, 71, 227, 228, 291, + 23, 24, 25, 26, 119, 27, 148, 149, 28, 29, + 90, 30, 61, 62, 93, 31, 80, 128, 182, 116, + 314, 358, 65, 152, 153, 221, 43, 97, 129, 103, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 105, 106, 107, + 108, 109, 246, 247, 248, 335, 249, 44, 250, 188, + 189, 251, 311, 362, 54, 167 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -911,122 +910,118 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 47, 149, 32, 160, 99, 74, 31, 237, 231, 359, - 43, 94, 95, 73, 282, 1, 292, 155, 307, 254, - 179, 46, 158, 2, 75, 110, 283, 297, 214, 352, - 3, 180, 178, 289, 175, 4, 208, 69, 171, 72, - 173, 9, 5, 6, 78, 79, 54, 329, 255, 298, - 182, 7, 8, 180, 215, 179, 151, 9, 115, 94, - 95, 73, 10, 180, 317, 293, 84, 108, 109, 84, - 247, 30, 182, 344, 212, 239, 55, 295, 217, 31, - 234, 156, 182, 284, 180, 349, 11, 257, 33, 34, - 171, 314, 249, 219, 251, 116, 285, 96, 341, 39, - 37, 207, 164, 182, 9, 252, 258, 253, 56, 38, - 174, 259, 260, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 149, 115, 94, 95, 73, - 117, 181, 115, 94, 95, 73, 178, 12, 35, 40, - 48, 54, 191, 232, 121, 96, 274, 335, 240, 115, - 94, 95, 73, 12, 180, 233, 191, 97, 229, 204, - 44, 205, 51, 116, 118, 36, 181, 345, 99, 169, - 273, 55, 160, 182, 311, 205, 9, 152, 119, 146, - 153, 49, 163, 280, 150, 226, 185, 45, 227, 62, - 63, 277, 120, 121, 278, 165, 64, 166, 117, 59, - 122, 65, 70, 56, 117, 97, 287, 321, 66, 288, - 153, 299, 191, 96, 186, 323, 99, 322, 73, 96, - 178, 117, 75, 296, 77, 290, 201, 202, 203, 204, - 333, 205, 118, 80, 83, 81, 96, 337, 170, 338, - 178, 89, 153, 300, 313, 347, 119, 301, 178, 87, - 91, 93, 119, 302, 303, 170, 105, 187, 186, 348, - 120, 121, 86, 356, 358, 86, 120, 121, 122, 119, - 107, -191, 304, 97, 122, 110, 112, 142, 188, 97, - 113, 145, 59, 120, 121, 154, 189, 190, 94, 161, - 167, 122, 339, 191, 192, 193, 97, 194, 195, 196, - 334, 187, 197, 198, 168, 199, 200, 201, 202, 203, - 204, 172, 205, 176, 186, 178, 206, 209, 340, 213, - 220, 218, 236, 299, 221, 224, 225, 228, 9, 235, - 250, 190, 291, 256, 305, 238, 276, 191, 192, 193, - 186, 194, 195, 196, 281, 294, 197, 198, 254, 199, - 200, 201, 202, 203, 204, 300, 205, 187, 308, 301, - 180, 312, 315, 205, 324, 302, 303, 316, 325, 350, - 327, 310, 328, 186, 326, 331, 332, 336, 236, 343, - 346, 355, 166, 187, 304, 361, 82, 190, 53, 318, - 319, 68, 320, 191, 192, 193, 157, 194, 195, 196, - 354, 186, 197, 198, 236, 199, 200, 201, 202, 203, - 204, 275, 205, 190, 90, 60, 187, 351, 230, 191, - 192, 193, 279, 194, 195, 196, 342, 186, 197, 198, - 360, 199, 200, 201, 202, 203, 204, 236, 205, 0, - 248, 0, 0, 0, -192, 0, 190, 0, 0, 0, - 0, 0, 191, 192, 193, 0, 194, 195, 196, 0, - 0, 197, 198, 0, 199, 200, 201, 202, 203, 204, - 0, 205, 0, 0, 190, 0, 0, 0, 0, 0, - 191, -192, -192, 0, -192, 195, 196, 0, 0, 197, - 198, 0, 199, 200, 201, 202, 203, 204, 299, 205, - 190, 0, 0, 0, 0, 0, 191, 0, 0, 0, - 0, -192, -192, 0, 0, -192, -192, 0, 199, 200, - 201, 202, 203, 204, 0, 205, 0, 0, 0, 0, - 300, 0, 0, 0, 301, 0, 0, 0, 0, 0, - 302, 303, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -191, 304 + 51, 154, 34, 104, 78, 165, 33, 242, 236, 364, + 45, 99, 100, 77, 287, 9, 79, 1, 160, 312, + 297, 259, 163, 185, 115, 2, 288, 294, 213, 37, + 50, 184, 3, 58, 180, 219, 217, 4, 48, 73, + 222, 76, 187, 303, 5, 6, 82, 83, 84, 32, + 260, 357, 184, 7, 8, 176, 38, 178, 156, 9, + 185, 220, 252, 59, 10, 298, 304, 244, 322, 33, + 49, 113, 114, 120, 99, 100, 77, 35, 89, 187, + 239, 89, 161, 289, 120, 99, 100, 77, 11, 36, + 42, 319, 254, 224, 256, 60, 290, 101, 305, 346, + 212, 185, 306, 12, 39, 41, 169, 176, 307, 308, + 121, 13, 53, 40, 179, 120, 99, 100, 77, 9, + 187, 121, 257, 334, 258, 154, -194, 309, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 186, 237, 126, 122, 279, 340, 245, 349, + 234, 185, 174, 52, 262, 13, 122, 102, 183, 238, + 101, 354, 300, 186, 55, 46, 58, 350, 104, 185, + 187, 101, 278, 263, 165, 196, 170, 66, 171, 123, + 120, 99, 100, 77, 196, 285, 191, 122, 187, 310, + 123, 316, 47, 124, 210, 196, 59, 304, 206, 207, + 208, 209, 101, 210, 124, 9, 91, 125, 126, 91, + 67, 168, 209, 68, 210, 127, 104, 190, 125, 126, + 102, 175, 157, 69, 63, 158, 127, 301, 60, 305, + 295, 102, 328, 306, 70, 124, 302, 151, 74, 307, + 308, 183, 155, 355, 77, 191, 79, 338, 318, 125, + 126, 304, 122, 231, 81, 85, 232, 127, 309, 195, + 86, 92, 102, 361, 363, 196, 282, 101, 88, 283, + -195, -195, 96, 94, -195, -195, 353, 204, 205, 206, + 207, 208, 209, 305, 210, 98, 175, 306, 192, 191, + 110, 356, 292, 307, 308, 293, 326, 112, 327, 158, + 124, 183, 115, 117, 339, 342, 147, 343, 183, 193, + 158, -194, 309, 352, 125, 126, 183, 194, 195, 63, + 118, 150, 127, 344, 196, 197, 198, 102, 199, 200, + 201, 159, 192, 202, 203, 99, 204, 205, 206, 207, + 208, 209, 166, 210, 172, 191, 173, 177, 181, 345, + 183, 214, 211, 241, 218, 223, 226, 225, 230, 233, + 229, 9, 195, 240, 255, 243, 261, 281, 196, 197, + 198, 191, 199, 200, 201, 286, 296, 202, 203, 299, + 204, 205, 206, 207, 208, 209, 259, 210, 192, 313, + 185, 320, 317, 210, 331, 321, 332, 336, 333, 329, + 330, 341, 315, 360, 191, 337, 348, 351, 366, 241, + 171, 87, 57, 323, 192, 324, 72, 325, 195, 162, + 280, 95, 64, 253, 196, 197, 198, 347, 199, 200, + 201, 359, 191, 202, 203, 241, 204, 205, 206, 207, + 208, 209, 235, 210, 195, 284, 0, 192, 365, 0, + 196, 197, 198, 0, 199, 200, 201, 0, 0, 202, + 203, 0, 204, 205, 206, 207, 208, 209, 241, 210, + 0, 0, 0, 0, 0, -195, 0, 195, 0, 0, + 0, 0, 0, 196, 197, 198, 0, 199, 200, 201, + 0, 0, 202, 203, 0, 204, 205, 206, 207, 208, + 209, 0, 210, 0, 0, 195, 0, 0, 0, 0, + 0, 196, -195, -195, 0, -195, 200, 201, 0, 0, + 202, 203, 0, 204, 205, 206, 207, 208, 209, 0, + 210 }; static const yytype_int16 yycheck[] = { - 12, 89, 2, 112, 64, 40, 3, 172, 3, 3, - 10, 4, 5, 6, 25, 7, 228, 81, 245, 88, - 3, 12, 110, 15, 12, 73, 37, 144, 77, 42, - 22, 102, 149, 224, 122, 27, 143, 37, 118, 39, - 120, 49, 34, 35, 44, 45, 9, 305, 117, 240, - 121, 43, 44, 102, 103, 3, 91, 49, 3, 4, - 5, 6, 54, 102, 276, 230, 57, 67, 68, 60, - 177, 27, 121, 331, 146, 146, 39, 95, 150, 3, - 168, 145, 121, 94, 102, 343, 78, 90, 3, 3, - 170, 256, 180, 153, 182, 40, 107, 90, 325, 85, - 81, 149, 114, 121, 49, 185, 109, 187, 71, 81, - 122, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 213, 3, 4, 5, 6, - 75, 114, 3, 4, 5, 6, 149, 145, 70, 113, - 0, 9, 124, 138, 138, 90, 206, 312, 145, 3, - 4, 5, 6, 145, 102, 167, 124, 150, 146, 141, - 70, 143, 99, 40, 109, 97, 114, 332, 228, 40, - 205, 39, 281, 121, 254, 143, 49, 146, 123, 85, - 149, 148, 55, 218, 90, 146, 17, 97, 149, 3, - 147, 146, 137, 138, 149, 145, 145, 147, 75, 67, - 145, 81, 104, 71, 75, 150, 146, 146, 116, 149, - 149, 26, 124, 90, 45, 295, 276, 146, 6, 90, - 149, 75, 12, 235, 111, 225, 138, 139, 140, 141, - 310, 143, 109, 146, 84, 146, 90, 146, 109, 146, - 149, 115, 149, 58, 256, 146, 123, 62, 149, 101, - 63, 3, 123, 68, 69, 109, 4, 88, 45, 339, - 137, 138, 57, 351, 352, 60, 137, 138, 145, 123, - 109, 86, 87, 150, 145, 73, 80, 3, 109, 150, - 145, 145, 67, 137, 138, 40, 117, 118, 4, 3, - 145, 145, 79, 124, 125, 126, 150, 128, 129, 130, - 312, 88, 133, 134, 98, 136, 137, 138, 139, 140, - 141, 143, 143, 81, 45, 149, 126, 3, 105, 149, - 112, 46, 109, 26, 3, 114, 85, 145, 49, 145, - 3, 118, 3, 145, 149, 146, 145, 124, 125, 126, - 45, 128, 129, 130, 80, 146, 133, 134, 88, 136, - 137, 138, 139, 140, 141, 58, 143, 88, 60, 62, - 102, 145, 90, 143, 146, 68, 69, 144, 146, 72, - 68, 102, 68, 45, 86, 86, 115, 146, 109, 149, - 146, 145, 147, 88, 87, 146, 49, 118, 17, 278, - 281, 36, 288, 124, 125, 126, 109, 128, 129, 130, - 105, 45, 133, 134, 109, 136, 137, 138, 139, 140, - 141, 207, 143, 118, 60, 29, 88, 120, 165, 124, - 125, 126, 213, 128, 129, 130, 326, 45, 133, 134, - 355, 136, 137, 138, 139, 140, 141, 109, 143, -1, - 178, -1, -1, -1, 88, -1, 118, -1, -1, -1, - -1, -1, 124, 125, 126, -1, 128, 129, 130, -1, - -1, 133, 134, -1, 136, 137, 138, 139, 140, 141, - -1, 143, -1, -1, 118, -1, -1, -1, -1, -1, + 13, 94, 2, 68, 42, 117, 3, 177, 3, 3, + 10, 4, 5, 6, 25, 49, 12, 7, 81, 250, + 233, 88, 115, 102, 73, 15, 37, 229, 148, 70, + 13, 3, 22, 9, 127, 77, 151, 27, 19, 39, + 155, 41, 121, 245, 34, 35, 46, 47, 48, 27, + 117, 42, 3, 43, 44, 123, 97, 125, 96, 49, + 102, 103, 182, 39, 54, 235, 26, 146, 281, 3, + 51, 71, 72, 3, 4, 5, 6, 3, 61, 121, + 173, 64, 145, 94, 3, 4, 5, 6, 78, 3, + 113, 261, 185, 158, 187, 71, 107, 90, 58, 330, + 149, 102, 62, 93, 81, 85, 119, 175, 68, 69, + 40, 145, 148, 81, 127, 3, 4, 5, 6, 49, + 121, 40, 190, 310, 192, 218, 86, 87, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 114, 138, 138, 75, 211, 317, 145, 336, + 146, 102, 40, 0, 90, 145, 75, 150, 149, 172, + 90, 348, 95, 114, 99, 70, 9, 337, 233, 102, + 121, 90, 210, 109, 286, 124, 145, 3, 147, 109, + 3, 4, 5, 6, 124, 223, 45, 75, 121, 149, + 109, 259, 97, 123, 143, 124, 39, 26, 138, 139, + 140, 141, 90, 143, 123, 49, 61, 137, 138, 64, + 147, 55, 141, 145, 143, 145, 281, 17, 137, 138, + 150, 109, 146, 81, 67, 149, 145, 240, 71, 58, + 230, 150, 300, 62, 116, 123, 144, 90, 104, 68, + 69, 149, 95, 72, 6, 45, 12, 315, 261, 137, + 138, 26, 75, 146, 111, 146, 149, 145, 87, 118, + 146, 101, 150, 356, 357, 124, 146, 90, 84, 149, + 129, 130, 63, 115, 133, 134, 344, 136, 137, 138, + 139, 140, 141, 58, 143, 3, 109, 62, 88, 45, + 4, 120, 146, 68, 69, 149, 146, 109, 146, 149, + 123, 149, 73, 80, 317, 146, 3, 146, 149, 109, + 149, 86, 87, 146, 137, 138, 149, 117, 118, 67, + 145, 145, 145, 79, 124, 125, 126, 150, 128, 129, + 130, 40, 88, 133, 134, 4, 136, 137, 138, 139, + 140, 141, 3, 143, 145, 45, 98, 143, 81, 105, + 149, 3, 126, 109, 149, 46, 3, 112, 85, 145, + 114, 49, 118, 145, 3, 146, 145, 145, 124, 125, + 126, 45, 128, 129, 130, 80, 3, 133, 134, 146, + 136, 137, 138, 139, 140, 141, 88, 143, 88, 60, + 102, 90, 145, 143, 86, 144, 68, 86, 68, 146, + 146, 146, 102, 145, 45, 115, 149, 146, 146, 109, + 147, 53, 18, 283, 88, 286, 38, 293, 118, 114, + 212, 64, 31, 183, 124, 125, 126, 331, 128, 129, + 130, 105, 45, 133, 134, 109, 136, 137, 138, 139, + 140, 141, 170, 143, 118, 218, -1, 88, 360, -1, 124, 125, 126, -1, 128, 129, 130, -1, -1, 133, - 134, -1, 136, 137, 138, 139, 140, 141, 26, 143, - 118, -1, -1, -1, -1, -1, 124, -1, -1, -1, - -1, 129, 130, -1, -1, 133, 134, -1, 136, 137, - 138, 139, 140, 141, -1, 143, -1, -1, -1, -1, - 58, -1, -1, -1, 62, -1, -1, -1, -1, -1, - 68, 69, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 86, 87 + 134, -1, 136, 137, 138, 139, 140, 141, 109, 143, + -1, -1, -1, -1, -1, 88, -1, 118, -1, -1, + -1, -1, -1, 124, 125, 126, -1, 128, 129, 130, + -1, -1, 133, 134, -1, 136, 137, 138, 139, 140, + 141, -1, 143, -1, -1, 118, -1, -1, -1, -1, + -1, 124, 125, 126, -1, 128, 129, 130, -1, -1, + 133, 134, -1, 136, 137, 138, 139, 140, 141, -1, + 143 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -1034,92 +1029,92 @@ static const yytype_int16 yycheck[] = static const yytype_uint8 yystos[] = { 0, 7, 15, 22, 27, 34, 35, 43, 44, 49, - 54, 78, 145, 152, 153, 154, 155, 159, 161, 162, - 165, 170, 171, 172, 173, 175, 178, 179, 181, 185, - 27, 3, 228, 3, 3, 70, 97, 81, 81, 85, - 113, 196, 227, 228, 70, 97, 179, 181, 0, 148, - 234, 99, 156, 156, 9, 39, 71, 182, 183, 67, - 182, 192, 3, 147, 145, 81, 116, 166, 166, 228, - 104, 163, 228, 6, 219, 12, 186, 111, 228, 228, - 146, 146, 154, 84, 179, 180, 185, 101, 184, 115, - 180, 63, 197, 3, 4, 5, 90, 150, 199, 216, - 217, 218, 219, 220, 221, 4, 160, 109, 228, 228, - 73, 189, 80, 145, 174, 3, 40, 75, 109, 123, - 137, 138, 145, 187, 198, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 3, 176, 177, 145, 192, 193, 194, 201, - 192, 219, 146, 149, 40, 81, 145, 174, 201, 164, - 217, 3, 235, 55, 181, 145, 147, 145, 98, 40, - 109, 202, 143, 202, 181, 201, 81, 188, 149, 3, - 102, 114, 121, 229, 230, 17, 45, 88, 109, 117, - 118, 124, 125, 126, 128, 129, 130, 133, 134, 136, - 137, 138, 139, 140, 141, 143, 126, 149, 189, 3, - 157, 158, 197, 149, 77, 103, 195, 197, 46, 216, - 112, 3, 167, 168, 114, 85, 146, 149, 145, 146, - 186, 3, 138, 181, 201, 145, 109, 198, 146, 146, - 145, 222, 223, 224, 226, 228, 231, 189, 200, 201, - 3, 201, 202, 202, 88, 117, 145, 90, 109, 202, - 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, - 202, 202, 202, 219, 216, 177, 145, 146, 149, 194, - 219, 80, 25, 37, 94, 107, 169, 146, 149, 178, - 228, 3, 199, 198, 146, 95, 181, 144, 178, 26, - 58, 62, 68, 69, 87, 149, 232, 230, 60, 190, - 102, 202, 145, 181, 198, 90, 144, 199, 158, 164, - 168, 146, 146, 202, 146, 146, 86, 68, 68, 223, - 225, 86, 115, 202, 181, 198, 146, 146, 146, 79, - 105, 230, 224, 149, 223, 198, 146, 146, 202, 223, - 72, 120, 42, 191, 105, 145, 201, 233, 201, 3, - 215, 146 + 54, 78, 93, 145, 152, 153, 154, 155, 159, 161, + 162, 165, 166, 171, 172, 173, 174, 176, 179, 180, + 182, 186, 27, 3, 229, 3, 3, 70, 97, 81, + 81, 85, 113, 197, 228, 229, 70, 97, 19, 51, + 180, 182, 0, 148, 235, 99, 156, 156, 9, 39, + 71, 183, 184, 67, 183, 193, 3, 147, 145, 81, + 116, 167, 167, 229, 104, 163, 229, 6, 220, 12, + 187, 111, 229, 229, 229, 146, 146, 154, 84, 180, + 181, 186, 101, 185, 115, 181, 63, 198, 3, 4, + 5, 90, 150, 200, 217, 218, 219, 220, 221, 222, + 4, 160, 109, 229, 229, 73, 190, 80, 145, 175, + 3, 40, 75, 109, 123, 137, 138, 145, 188, 199, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 3, 177, 178, + 145, 193, 194, 195, 202, 193, 220, 146, 149, 40, + 81, 145, 175, 202, 164, 218, 3, 236, 55, 182, + 145, 147, 145, 98, 40, 109, 203, 143, 203, 182, + 202, 81, 189, 149, 3, 102, 114, 121, 230, 231, + 17, 45, 88, 109, 117, 118, 124, 125, 126, 128, + 129, 130, 133, 134, 136, 137, 138, 139, 140, 141, + 143, 126, 149, 190, 3, 157, 158, 198, 149, 77, + 103, 196, 198, 46, 217, 112, 3, 168, 169, 114, + 85, 146, 149, 145, 146, 187, 3, 138, 182, 202, + 145, 109, 199, 146, 146, 145, 223, 224, 225, 227, + 229, 232, 190, 201, 202, 3, 202, 203, 203, 88, + 117, 145, 90, 109, 203, 203, 203, 203, 203, 203, + 203, 203, 203, 203, 203, 203, 203, 203, 220, 217, + 178, 145, 146, 149, 195, 220, 80, 25, 37, 94, + 107, 170, 146, 149, 179, 229, 3, 200, 199, 146, + 95, 182, 144, 179, 26, 58, 62, 68, 69, 87, + 149, 233, 231, 60, 191, 102, 203, 145, 182, 199, + 90, 144, 200, 158, 164, 169, 146, 146, 203, 146, + 146, 86, 68, 68, 224, 226, 86, 115, 203, 182, + 199, 146, 146, 146, 79, 105, 231, 225, 149, 224, + 199, 146, 146, 203, 224, 72, 120, 42, 192, 105, + 145, 202, 234, 202, 3, 216, 146 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 151, 152, 153, 153, 154, 154, 155, 155, 155, - 155, 155, 155, 155, 155, 155, 156, 156, 157, 157, - 158, 158, 159, 160, 161, 161, 162, 163, 164, 165, - 165, 165, 166, 166, 167, 167, 168, 169, 169, 169, - 169, 170, 170, 170, 171, 172, 173, 173, 174, 174, - 175, 176, 176, 177, 178, 178, 178, 179, 179, 180, - 180, 181, 181, 182, 183, 183, 183, 184, 184, 185, - 186, 186, 187, 188, 189, 189, 190, 190, 191, 191, - 192, 192, 193, 193, 194, 195, 195, 195, 196, 196, - 197, 197, 197, 198, 198, 199, 199, 200, 201, 201, - 201, 201, 201, 202, 202, 202, 202, 202, 202, 202, - 202, 202, 203, 203, 204, 204, 204, 204, 204, 205, - 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, - 206, 206, 207, 207, 207, 207, 208, 208, 209, 209, - 210, 210, 210, 210, 210, 210, 211, 211, 212, 213, - 214, 215, 215, 215, 215, 216, 216, 216, 216, 217, - 218, 218, 219, 220, 221, 222, 222, 223, 223, 224, - 224, 225, 225, 226, 227, 228, 228, 229, 229, 230, - 230, 231, 231, 231, 232, 232, 232, 232, 232, 232, - 232, 232, 233, 234, 234, 235, 235 + 0, 151, 152, 153, 153, 154, 154, 154, 155, 155, + 155, 155, 155, 155, 155, 155, 155, 156, 156, 157, + 157, 158, 158, 159, 160, 161, 161, 162, 163, 164, + 165, 165, 166, 166, 166, 167, 167, 168, 168, 169, + 170, 170, 170, 170, 171, 171, 171, 172, 173, 174, + 174, 175, 175, 176, 177, 177, 178, 179, 179, 179, + 180, 180, 181, 181, 182, 182, 183, 184, 184, 184, + 185, 185, 186, 187, 187, 188, 189, 190, 190, 191, + 191, 192, 192, 193, 193, 194, 194, 195, 196, 196, + 196, 197, 197, 198, 198, 198, 199, 199, 200, 200, + 201, 202, 202, 202, 202, 202, 203, 203, 203, 203, + 203, 203, 203, 203, 203, 204, 204, 205, 205, 205, + 205, 205, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 206, 206, 207, 207, 208, 208, 208, 208, 209, + 209, 210, 210, 211, 211, 211, 211, 211, 211, 212, + 212, 213, 214, 215, 216, 216, 216, 216, 217, 217, + 217, 217, 218, 219, 219, 220, 221, 222, 223, 223, + 224, 224, 225, 225, 226, 226, 227, 228, 229, 229, + 230, 230, 231, 231, 232, 232, 232, 233, 233, 233, + 233, 233, 233, 233, 233, 234, 235, 235, 236, 236 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 2, 1, 3, 2, 2, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 5, 0, 1, 3, - 1, 4, 4, 1, 2, 5, 7, 1, 1, 8, - 7, 7, 3, 0, 1, 3, 2, 1, 1, 1, - 1, 3, 3, 3, 4, 2, 8, 5, 3, 0, - 5, 1, 3, 3, 1, 1, 5, 3, 3, 1, - 1, 3, 5, 2, 1, 1, 1, 1, 0, 7, - 1, 0, 1, 2, 2, 0, 4, 0, 2, 0, - 3, 0, 1, 3, 2, 1, 1, 0, 2, 0, - 2, 4, 0, 1, 3, 1, 3, 2, 1, 1, - 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, - 1, 3, 1, 1, 2, 2, 2, 3, 4, 1, - 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, - 3, 3, 5, 6, 5, 6, 6, 8, 4, 5, - 3, 3, 3, 3, 3, 3, 3, 5, 4, 4, - 5, 1, 3, 1, 3, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, - 4, 1, 3, 2, 1, 1, 3, 2, 1, 1, - 0, 4, 6, 8, 1, 1, 2, 2, 1, 1, - 1, 0, 1, 1, 0, 1, 3 + 1, 1, 1, 1, 1, 1, 1, 5, 0, 1, + 3, 1, 4, 4, 1, 2, 5, 7, 1, 1, + 2, 3, 8, 7, 7, 3, 0, 1, 3, 2, + 1, 1, 1, 1, 3, 3, 3, 4, 2, 8, + 5, 3, 0, 5, 1, 3, 3, 1, 1, 5, + 3, 3, 1, 1, 3, 5, 2, 1, 1, 1, + 1, 0, 7, 1, 0, 1, 2, 2, 0, 4, + 0, 2, 0, 3, 0, 1, 3, 2, 1, 1, + 0, 2, 0, 2, 4, 0, 1, 3, 1, 3, + 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, + 1, 1, 1, 1, 3, 1, 1, 2, 2, 2, + 3, 4, 1, 3, 3, 3, 3, 3, 3, 3, + 4, 3, 3, 3, 3, 5, 6, 5, 6, 6, + 8, 4, 5, 3, 3, 3, 3, 3, 3, 3, + 5, 4, 4, 5, 1, 3, 1, 3, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 1, 1, 1, 4, 1, 3, 2, 1, 1, 3, + 2, 1, 1, 0, 4, 6, 8, 1, 1, 2, + 2, 1, 1, 1, 0, 1, 1, 0, 1, 3 }; @@ -1616,31 +1611,31 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio switch (yytype) { case 3: /* IDENTIFIER */ -#line 135 "bison_parser.y" /* yacc.c:1257 */ +#line 136 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).sval)) ); } -#line 1622 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1617 "bison_parser.cpp" /* yacc.c:1257 */ break; case 4: /* STRING */ -#line 135 "bison_parser.y" /* yacc.c:1257 */ +#line 136 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).sval)) ); } -#line 1628 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1623 "bison_parser.cpp" /* yacc.c:1257 */ break; case 5: /* FLOATVAL */ -#line 134 "bison_parser.y" /* yacc.c:1257 */ +#line 135 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1634 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1629 "bison_parser.cpp" /* yacc.c:1257 */ break; case 6: /* INTVAL */ -#line 134 "bison_parser.y" /* yacc.c:1257 */ +#line 135 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1640 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1635 "bison_parser.cpp" /* yacc.c:1257 */ break; case 153: /* statement_list */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ +#line 137 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).stmt_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).stmt_vec))) { @@ -1649,23 +1644,23 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).stmt_vec)); } -#line 1653 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1648 "bison_parser.cpp" /* yacc.c:1257 */ break; case 154: /* statement */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).statement)); } -#line 1659 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1654 "bison_parser.cpp" /* yacc.c:1257 */ break; case 155: /* preparable_statement */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).statement)); } -#line 1665 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1660 "bison_parser.cpp" /* yacc.c:1257 */ break; case 156: /* opt_hints */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ +#line 137 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).expr_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -1674,11 +1669,11 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).expr_vec)); } -#line 1678 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1673 "bison_parser.cpp" /* yacc.c:1257 */ break; case 157: /* hint_list */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ +#line 137 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).expr_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -1687,65 +1682,71 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).expr_vec)); } -#line 1691 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1686 "bison_parser.cpp" /* yacc.c:1257 */ break; case 158: /* hint */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 1697 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1692 "bison_parser.cpp" /* yacc.c:1257 */ break; case 159: /* prepare_statement */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).prep_stmt)); } -#line 1703 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1698 "bison_parser.cpp" /* yacc.c:1257 */ break; case 160: /* prepare_target_query */ -#line 135 "bison_parser.y" /* yacc.c:1257 */ +#line 136 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).sval)) ); } -#line 1709 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1704 "bison_parser.cpp" /* yacc.c:1257 */ break; case 161: /* execute_statement */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).exec_stmt)); } -#line 1715 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1710 "bison_parser.cpp" /* yacc.c:1257 */ break; case 162: /* import_statement */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).import_stmt)); } -#line 1721 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1716 "bison_parser.cpp" /* yacc.c:1257 */ break; case 163: /* import_file_type */ -#line 134 "bison_parser.y" /* yacc.c:1257 */ +#line 135 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1727 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1722 "bison_parser.cpp" /* yacc.c:1257 */ break; case 164: /* file_path */ -#line 135 "bison_parser.y" /* yacc.c:1257 */ - { free( (((*yyvaluep).sval)) ); } -#line 1733 "bison_parser.cpp" /* yacc.c:1257 */ - break; - - case 165: /* create_statement */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ - { delete (((*yyvaluep).create_stmt)); } -#line 1739 "bison_parser.cpp" /* yacc.c:1257 */ - break; - - case 166: /* opt_not_exists */ -#line 134 "bison_parser.y" /* yacc.c:1257 */ - { } -#line 1745 "bison_parser.cpp" /* yacc.c:1257 */ - break; - - case 167: /* column_def_commalist */ #line 136 "bison_parser.y" /* yacc.c:1257 */ + { free( (((*yyvaluep).sval)) ); } +#line 1728 "bison_parser.cpp" /* yacc.c:1257 */ + break; + + case 165: /* show_statement */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ + { delete (((*yyvaluep).show_stmt)); } +#line 1734 "bison_parser.cpp" /* yacc.c:1257 */ + break; + + case 166: /* create_statement */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ + { delete (((*yyvaluep).create_stmt)); } +#line 1740 "bison_parser.cpp" /* yacc.c:1257 */ + break; + + case 167: /* opt_not_exists */ +#line 135 "bison_parser.y" /* yacc.c:1257 */ + { } +#line 1746 "bison_parser.cpp" /* yacc.c:1257 */ + break; + + case 168: /* column_def_commalist */ +#line 137 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).column_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).column_vec))) { @@ -1754,47 +1755,47 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).column_vec)); } -#line 1758 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1759 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 168: /* column_def */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 169: /* column_def */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).column_t)); } -#line 1764 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1765 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 169: /* column_type */ -#line 134 "bison_parser.y" /* yacc.c:1257 */ + case 170: /* column_type */ +#line 135 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1770 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1771 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 170: /* drop_statement */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 171: /* drop_statement */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).drop_stmt)); } -#line 1776 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1777 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 171: /* delete_statement */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 172: /* delete_statement */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).delete_stmt)); } -#line 1782 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1783 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 172: /* truncate_statement */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 173: /* truncate_statement */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).delete_stmt)); } -#line 1788 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1789 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 173: /* insert_statement */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 174: /* insert_statement */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).insert_stmt)); } -#line 1794 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1795 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 174: /* opt_column_list */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ + case 175: /* opt_column_list */ +#line 137 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).str_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).str_vec))) { @@ -1803,17 +1804,17 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).str_vec)); } -#line 1807 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1808 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 175: /* update_statement */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 176: /* update_statement */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).update_stmt)); } -#line 1813 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1814 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 176: /* update_clause_commalist */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ + case 177: /* update_clause_commalist */ +#line 137 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).update_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).update_vec))) { @@ -1822,53 +1823,53 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).update_vec)); } -#line 1826 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1827 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 177: /* update_clause */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 178: /* update_clause */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).update_t)); } -#line 1832 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1833 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 178: /* select_statement */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 179: /* select_statement */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).select_stmt)); } -#line 1838 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1839 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 179: /* select_with_paren */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 180: /* select_with_paren */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).select_stmt)); } -#line 1844 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1845 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 180: /* select_paren_or_clause */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 181: /* select_paren_or_clause */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).select_stmt)); } -#line 1850 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1851 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 181: /* select_no_paren */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 182: /* select_no_paren */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).select_stmt)); } -#line 1856 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1857 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 185: /* select_clause */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 186: /* select_clause */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).select_stmt)); } -#line 1862 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1863 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 186: /* opt_distinct */ -#line 134 "bison_parser.y" /* yacc.c:1257 */ + case 187: /* opt_distinct */ +#line 135 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1868 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1869 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 187: /* select_list */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ + case 188: /* select_list */ +#line 137 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).expr_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -1877,35 +1878,35 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).expr_vec)); } -#line 1881 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1882 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 188: /* from_clause */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 189: /* from_clause */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 1887 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1888 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 189: /* opt_where */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 190: /* opt_where */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 1893 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1894 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 190: /* opt_group */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 191: /* opt_group */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).group_t)); } -#line 1899 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1900 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 191: /* opt_having */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 192: /* opt_having */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 1905 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1906 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 192: /* opt_order */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ + case 193: /* opt_order */ +#line 137 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).order_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).order_vec))) { @@ -1914,11 +1915,11 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).order_vec)); } -#line 1918 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1919 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 193: /* order_list */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ + case 194: /* order_list */ +#line 137 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).order_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).order_vec))) { @@ -1927,35 +1928,35 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).order_vec)); } -#line 1931 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1932 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 194: /* order_desc */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 195: /* order_desc */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).order)); } -#line 1937 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1938 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 195: /* opt_order_type */ -#line 134 "bison_parser.y" /* yacc.c:1257 */ + case 196: /* opt_order_type */ +#line 135 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1943 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1944 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 196: /* opt_top */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 197: /* opt_top */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).limit)); } -#line 1949 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1950 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 197: /* opt_limit */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 198: /* opt_limit */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).limit)); } -#line 1955 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1956 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 198: /* expr_list */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ + case 199: /* expr_list */ +#line 137 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).expr_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -1964,11 +1965,11 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).expr_vec)); } -#line 1968 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1969 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 199: /* literal_list */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ + case 200: /* literal_list */ +#line 137 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).expr_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -1977,161 +1978,161 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).expr_vec)); } -#line 1981 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1982 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 200: /* expr_alias */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 201: /* expr_alias */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 1987 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1988 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 201: /* expr */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 202: /* expr */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 1993 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1994 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 202: /* operand */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 203: /* operand */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 1999 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2000 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 203: /* scalar_expr */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 204: /* scalar_expr */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2005 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2006 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 204: /* unary_expr */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 205: /* unary_expr */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2011 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2012 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 205: /* binary_expr */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 206: /* binary_expr */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2017 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2018 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 206: /* logic_expr */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 207: /* logic_expr */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2023 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2024 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 207: /* in_expr */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 208: /* in_expr */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2029 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2030 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 208: /* case_expr */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 209: /* case_expr */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2035 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2036 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 209: /* exists_expr */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 210: /* exists_expr */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2041 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2042 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 210: /* comp_expr */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 211: /* comp_expr */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2047 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2048 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 211: /* function_expr */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 212: /* function_expr */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2053 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2054 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 212: /* array_expr */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 213: /* array_expr */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2059 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2060 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 213: /* array_index */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 214: /* array_index */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2065 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2066 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 214: /* between_expr */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 215: /* between_expr */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2071 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2072 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 215: /* column_name */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 216: /* column_name */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2077 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2078 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 216: /* literal */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 217: /* literal */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2083 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2084 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 217: /* string_literal */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 218: /* string_literal */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2089 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2090 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 218: /* num_literal */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 219: /* num_literal */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2095 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2096 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 219: /* int_literal */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 220: /* int_literal */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2101 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2102 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 220: /* null_literal */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 221: /* null_literal */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2107 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2108 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 221: /* param_expr */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 222: /* param_expr */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2113 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2114 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 222: /* table_ref */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 223: /* table_ref */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2119 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2120 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 223: /* table_ref_atomic */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 224: /* table_ref_atomic */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2125 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2126 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 224: /* nonjoin_table_ref_atomic */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 225: /* nonjoin_table_ref_atomic */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2131 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2132 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 225: /* table_ref_commalist */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ + case 226: /* table_ref_commalist */ +#line 137 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).table_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).table_vec))) { @@ -2140,59 +2141,59 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).table_vec)); } -#line 2144 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2145 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 226: /* table_ref_name */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 227: /* table_ref_name */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2150 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2151 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 227: /* table_ref_name_no_alias */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ + case 228: /* table_ref_name_no_alias */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2156 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2157 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 228: /* table_name */ -#line 135 "bison_parser.y" /* yacc.c:1257 */ - { free( (((*yyvaluep).sval)) ); } -#line 2162 "bison_parser.cpp" /* yacc.c:1257 */ - break; - - case 229: /* alias */ -#line 135 "bison_parser.y" /* yacc.c:1257 */ - { free( (((*yyvaluep).sval)) ); } -#line 2168 "bison_parser.cpp" /* yacc.c:1257 */ - break; - - case 230: /* opt_alias */ -#line 135 "bison_parser.y" /* yacc.c:1257 */ - { free( (((*yyvaluep).sval)) ); } -#line 2174 "bison_parser.cpp" /* yacc.c:1257 */ - break; - - case 231: /* join_clause */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ - { delete (((*yyvaluep).table)); } -#line 2180 "bison_parser.cpp" /* yacc.c:1257 */ - break; - - case 232: /* opt_join_type */ -#line 134 "bison_parser.y" /* yacc.c:1257 */ - { } -#line 2186 "bison_parser.cpp" /* yacc.c:1257 */ - break; - - case 233: /* join_condition */ -#line 144 "bison_parser.y" /* yacc.c:1257 */ - { delete (((*yyvaluep).expr)); } -#line 2192 "bison_parser.cpp" /* yacc.c:1257 */ - break; - - case 235: /* ident_commalist */ + case 229: /* table_name */ #line 136 "bison_parser.y" /* yacc.c:1257 */ + { free( (((*yyvaluep).sval)) ); } +#line 2163 "bison_parser.cpp" /* yacc.c:1257 */ + break; + + case 230: /* alias */ +#line 136 "bison_parser.y" /* yacc.c:1257 */ + { free( (((*yyvaluep).sval)) ); } +#line 2169 "bison_parser.cpp" /* yacc.c:1257 */ + break; + + case 231: /* opt_alias */ +#line 136 "bison_parser.y" /* yacc.c:1257 */ + { free( (((*yyvaluep).sval)) ); } +#line 2175 "bison_parser.cpp" /* yacc.c:1257 */ + break; + + case 232: /* join_clause */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ + { delete (((*yyvaluep).table)); } +#line 2181 "bison_parser.cpp" /* yacc.c:1257 */ + break; + + case 233: /* opt_join_type */ +#line 135 "bison_parser.y" /* yacc.c:1257 */ + { } +#line 2187 "bison_parser.cpp" /* yacc.c:1257 */ + break; + + case 234: /* join_condition */ +#line 145 "bison_parser.y" /* yacc.c:1257 */ + { delete (((*yyvaluep).expr)); } +#line 2193 "bison_parser.cpp" /* yacc.c:1257 */ + break; + + case 236: /* ident_commalist */ +#line 137 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).str_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).str_vec))) { @@ -2201,7 +2202,7 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).str_vec)); } -#line 2205 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2206 "bison_parser.cpp" /* yacc.c:1257 */ break; @@ -2319,7 +2320,7 @@ YYLTYPE yylloc = yyloc_default; yylloc.total_column = 0; } -#line 2323 "bison_parser.cpp" /* yacc.c:1429 */ +#line 2324 "bison_parser.cpp" /* yacc.c:1429 */ yylsp[0] = yylloc; goto yysetstate; @@ -2506,7 +2507,7 @@ yyreduce: switch (yyn) { case 2: -#line 240 "bison_parser.y" /* yacc.c:1646 */ +#line 242 "bison_parser.y" /* yacc.c:1646 */ { for (SQLStatement* stmt : *(yyvsp[-1].stmt_vec)) { // Transfers ownership of the statement. @@ -2524,211 +2525,236 @@ yyreduce: } delete (yyvsp[-1].stmt_vec); } -#line 2528 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2529 "bison_parser.cpp" /* yacc.c:1646 */ break; case 3: -#line 261 "bison_parser.y" /* yacc.c:1646 */ +#line 263 "bison_parser.y" /* yacc.c:1646 */ { (yyval.stmt_vec) = new std::vector(); (yyval.stmt_vec)->push_back((yyvsp[0].statement)); } -#line 2534 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2535 "bison_parser.cpp" /* yacc.c:1646 */ break; case 4: -#line 262 "bison_parser.y" /* yacc.c:1646 */ +#line 264 "bison_parser.y" /* yacc.c:1646 */ { (yyvsp[-2].stmt_vec)->push_back((yyvsp[0].statement)); (yyval.stmt_vec) = (yyvsp[-2].stmt_vec); } -#line 2540 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2541 "bison_parser.cpp" /* yacc.c:1646 */ break; case 5: -#line 266 "bison_parser.y" /* yacc.c:1646 */ +#line 268 "bison_parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[-1].prep_stmt); (yyval.statement)->hints = (yyvsp[0].expr_vec); } -#line 2549 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2550 "bison_parser.cpp" /* yacc.c:1646 */ break; case 6: -#line 270 "bison_parser.y" /* yacc.c:1646 */ +#line 272 "bison_parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[-1].statement); (yyval.statement)->hints = (yyvsp[0].expr_vec); } -#line 2558 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2559 "bison_parser.cpp" /* yacc.c:1646 */ break; case 7: -#line 278 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.statement) = (yyvsp[0].select_stmt); } -#line 2564 "bison_parser.cpp" /* yacc.c:1646 */ +#line 276 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.statement) = (yyvsp[0].show_stmt); + } +#line 2567 "bison_parser.cpp" /* yacc.c:1646 */ break; case 8: -#line 279 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.statement) = (yyvsp[0].import_stmt); } -#line 2570 "bison_parser.cpp" /* yacc.c:1646 */ +#line 283 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.statement) = (yyvsp[0].select_stmt); } +#line 2573 "bison_parser.cpp" /* yacc.c:1646 */ break; case 9: -#line 280 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.statement) = (yyvsp[0].create_stmt); } -#line 2576 "bison_parser.cpp" /* yacc.c:1646 */ +#line 284 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.statement) = (yyvsp[0].import_stmt); } +#line 2579 "bison_parser.cpp" /* yacc.c:1646 */ break; case 10: -#line 281 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.statement) = (yyvsp[0].insert_stmt); } -#line 2582 "bison_parser.cpp" /* yacc.c:1646 */ +#line 285 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.statement) = (yyvsp[0].create_stmt); } +#line 2585 "bison_parser.cpp" /* yacc.c:1646 */ break; case 11: -#line 282 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.statement) = (yyvsp[0].delete_stmt); } -#line 2588 "bison_parser.cpp" /* yacc.c:1646 */ +#line 286 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.statement) = (yyvsp[0].insert_stmt); } +#line 2591 "bison_parser.cpp" /* yacc.c:1646 */ break; case 12: -#line 283 "bison_parser.y" /* yacc.c:1646 */ +#line 287 "bison_parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].delete_stmt); } -#line 2594 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2597 "bison_parser.cpp" /* yacc.c:1646 */ break; case 13: -#line 284 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.statement) = (yyvsp[0].update_stmt); } -#line 2600 "bison_parser.cpp" /* yacc.c:1646 */ +#line 288 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.statement) = (yyvsp[0].delete_stmt); } +#line 2603 "bison_parser.cpp" /* yacc.c:1646 */ break; case 14: -#line 285 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.statement) = (yyvsp[0].drop_stmt); } -#line 2606 "bison_parser.cpp" /* yacc.c:1646 */ +#line 289 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.statement) = (yyvsp[0].update_stmt); } +#line 2609 "bison_parser.cpp" /* yacc.c:1646 */ break; case 15: -#line 286 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.statement) = (yyvsp[0].exec_stmt); } -#line 2612 "bison_parser.cpp" /* yacc.c:1646 */ +#line 290 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.statement) = (yyvsp[0].drop_stmt); } +#line 2615 "bison_parser.cpp" /* yacc.c:1646 */ break; case 16: -#line 295 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr_vec) = (yyvsp[-1].expr_vec); } -#line 2618 "bison_parser.cpp" /* yacc.c:1646 */ +#line 291 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.statement) = (yyvsp[0].exec_stmt); } +#line 2621 "bison_parser.cpp" /* yacc.c:1646 */ break; case 17: -#line 296 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr_vec) = nullptr; } -#line 2624 "bison_parser.cpp" /* yacc.c:1646 */ +#line 300 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr_vec) = (yyvsp[-1].expr_vec); } +#line 2627 "bison_parser.cpp" /* yacc.c:1646 */ break; case 18: #line 301 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } -#line 2630 "bison_parser.cpp" /* yacc.c:1646 */ + { (yyval.expr_vec) = nullptr; } +#line 2633 "bison_parser.cpp" /* yacc.c:1646 */ break; case 19: -#line 302 "bison_parser.y" /* yacc.c:1646 */ - { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } -#line 2636 "bison_parser.cpp" /* yacc.c:1646 */ +#line 306 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } +#line 2639 "bison_parser.cpp" /* yacc.c:1646 */ break; case 20: -#line 306 "bison_parser.y" /* yacc.c:1646 */ - { - (yyval.expr) = Expr::make(kExprHint); - (yyval.expr)->name = (yyvsp[0].sval); - } +#line 307 "bison_parser.y" /* yacc.c:1646 */ + { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } #line 2645 "bison_parser.cpp" /* yacc.c:1646 */ break; case 21: -#line 310 "bison_parser.y" /* yacc.c:1646 */ +#line 311 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.expr) = Expr::make(kExprHint); + (yyval.expr)->name = (yyvsp[0].sval); + } +#line 2654 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 22: +#line 315 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::make(kExprHint); (yyval.expr)->name = (yyvsp[-3].sval); (yyval.expr)->exprList = (yyvsp[-1].expr_vec); } -#line 2655 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2664 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 22: -#line 322 "bison_parser.y" /* yacc.c:1646 */ + case 23: +#line 327 "bison_parser.y" /* yacc.c:1646 */ { (yyval.prep_stmt) = new PrepareStatement(); (yyval.prep_stmt)->name = (yyvsp[-2].sval); (yyval.prep_stmt)->query = (yyvsp[0].sval); } -#line 2665 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 24: -#line 332 "bison_parser.y" /* yacc.c:1646 */ - { - (yyval.exec_stmt) = new ExecuteStatement(); - (yyval.exec_stmt)->name = (yyvsp[0].sval); - } #line 2674 "bison_parser.cpp" /* yacc.c:1646 */ break; case 25: -#line 336 "bison_parser.y" /* yacc.c:1646 */ +#line 337 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.exec_stmt) = new ExecuteStatement(); + (yyval.exec_stmt)->name = (yyvsp[0].sval); + } +#line 2683 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 26: +#line 341 "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 2684 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2693 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 26: -#line 348 "bison_parser.y" /* yacc.c:1646 */ + case 27: +#line 353 "bison_parser.y" /* yacc.c:1646 */ { (yyval.import_stmt) = new ImportStatement((ImportType) (yyvsp[-4].uval)); (yyval.import_stmt)->filePath = (yyvsp[-2].sval); (yyval.import_stmt)->tableName = (yyvsp[0].sval); } -#line 2694 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 27: -#line 356 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = kImportCSV; } -#line 2700 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2703 "bison_parser.cpp" /* yacc.c:1646 */ break; case 28: -#line 360 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.sval) = strdup((yyvsp[0].expr)->name); delete (yyvsp[0].expr); } -#line 2706 "bison_parser.cpp" /* yacc.c:1646 */ +#line 361 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kImportCSV; } +#line 2709 "bison_parser.cpp" /* yacc.c:1646 */ break; case 29: -#line 370 "bison_parser.y" /* yacc.c:1646 */ +#line 365 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.sval) = strdup((yyvsp[0].expr)->name); delete (yyvsp[0].expr); } +#line 2715 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 30: +#line 375 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.show_stmt) = new ShowStatement(kShowTables); + } +#line 2723 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 31: +#line 378 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.show_stmt) = new ShowStatement(kShowColumns); + (yyval.show_stmt)->name = (yyvsp[0].sval); + } +#line 2732 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 32: +#line 391 "bison_parser.y" /* yacc.c:1646 */ { (yyval.create_stmt) = new CreateStatement(kCreateTableFromTbl); (yyval.create_stmt)->ifNotExists = (yyvsp[-5].bval); (yyval.create_stmt)->tableName = (yyvsp[-4].sval); (yyval.create_stmt)->filePath = (yyvsp[0].sval); } -#line 2717 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2743 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 30: -#line 376 "bison_parser.y" /* yacc.c:1646 */ + case 33: +#line 397 "bison_parser.y" /* yacc.c:1646 */ { (yyval.create_stmt) = new CreateStatement(kCreateTable); (yyval.create_stmt)->ifNotExists = (yyvsp[-4].bval); (yyval.create_stmt)->tableName = (yyvsp[-3].sval); (yyval.create_stmt)->columns = (yyvsp[-1].column_vec); } -#line 2728 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2754 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 31: -#line 382 "bison_parser.y" /* yacc.c:1646 */ + case 34: +#line 403 "bison_parser.y" /* yacc.c:1646 */ { (yyval.create_stmt) = new CreateStatement(kCreateView); (yyval.create_stmt)->ifNotExists = (yyvsp[-4].bval); @@ -2736,180 +2762,180 @@ yyreduce: (yyval.create_stmt)->viewColumns = (yyvsp[-2].str_vec); (yyval.create_stmt)->select = (yyvsp[0].select_stmt); } -#line 2740 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 32: -#line 392 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.bval) = true; } -#line 2746 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 33: -#line 393 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.bval) = false; } -#line 2752 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 34: -#line 397 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.column_vec) = new std::vector(); (yyval.column_vec)->push_back((yyvsp[0].column_t)); } -#line 2758 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2766 "bison_parser.cpp" /* yacc.c:1646 */ break; case 35: -#line 398 "bison_parser.y" /* yacc.c:1646 */ - { (yyvsp[-2].column_vec)->push_back((yyvsp[0].column_t)); (yyval.column_vec) = (yyvsp[-2].column_vec); } -#line 2764 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 36: -#line 402 "bison_parser.y" /* yacc.c:1646 */ - { - (yyval.column_t) = new ColumnDefinition((yyvsp[-1].sval), (ColumnDefinition::DataType) (yyvsp[0].uval)); - } +#line 413 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.bval) = true; } #line 2772 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 37: -#line 409 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = ColumnDefinition::INT; } + case 36: +#line 414 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.bval) = false; } #line 2778 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 38: -#line 410 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = ColumnDefinition::INT; } + case 37: +#line 418 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.column_vec) = new std::vector(); (yyval.column_vec)->push_back((yyvsp[0].column_t)); } #line 2784 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 39: -#line 411 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = ColumnDefinition::DOUBLE; } + case 38: +#line 419 "bison_parser.y" /* yacc.c:1646 */ + { (yyvsp[-2].column_vec)->push_back((yyvsp[0].column_t)); (yyval.column_vec) = (yyvsp[-2].column_vec); } #line 2790 "bison_parser.cpp" /* yacc.c:1646 */ break; + case 39: +#line 423 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.column_t) = new ColumnDefinition((yyvsp[-1].sval), (ColumnDefinition::DataType) (yyvsp[0].uval)); + } +#line 2798 "bison_parser.cpp" /* yacc.c:1646 */ + break; + case 40: -#line 412 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = ColumnDefinition::TEXT; } -#line 2796 "bison_parser.cpp" /* yacc.c:1646 */ +#line 430 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = ColumnDefinition::INT; } +#line 2804 "bison_parser.cpp" /* yacc.c:1646 */ break; case 41: -#line 422 "bison_parser.y" /* yacc.c:1646 */ +#line 431 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = ColumnDefinition::INT; } +#line 2810 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 42: +#line 432 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = ColumnDefinition::DOUBLE; } +#line 2816 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 43: +#line 433 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = ColumnDefinition::TEXT; } +#line 2822 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 44: +#line 443 "bison_parser.y" /* yacc.c:1646 */ { (yyval.drop_stmt) = new DropStatement(kDropTable); (yyval.drop_stmt)->name = (yyvsp[0].sval); } -#line 2805 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2831 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 42: -#line 426 "bison_parser.y" /* yacc.c:1646 */ + case 45: +#line 447 "bison_parser.y" /* yacc.c:1646 */ { (yyval.drop_stmt) = new DropStatement(kDropView); (yyval.drop_stmt)->name = (yyvsp[0].sval); } -#line 2814 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2840 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 43: -#line 430 "bison_parser.y" /* yacc.c:1646 */ + case 46: +#line 451 "bison_parser.y" /* yacc.c:1646 */ { (yyval.drop_stmt) = new DropStatement(kDropPreparedStatement); (yyval.drop_stmt)->name = (yyvsp[0].sval); } -#line 2823 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2849 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 44: -#line 442 "bison_parser.y" /* yacc.c:1646 */ + case 47: +#line 463 "bison_parser.y" /* yacc.c:1646 */ { (yyval.delete_stmt) = new DeleteStatement(); (yyval.delete_stmt)->tableName = (yyvsp[-1].sval); (yyval.delete_stmt)->expr = (yyvsp[0].expr); } -#line 2833 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2859 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 45: -#line 450 "bison_parser.y" /* yacc.c:1646 */ + case 48: +#line 471 "bison_parser.y" /* yacc.c:1646 */ { (yyval.delete_stmt) = new DeleteStatement(); (yyval.delete_stmt)->tableName = (yyvsp[0].sval); } -#line 2842 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2868 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 46: -#line 462 "bison_parser.y" /* yacc.c:1646 */ + case 49: +#line 483 "bison_parser.y" /* yacc.c:1646 */ { (yyval.insert_stmt) = new InsertStatement(kInsertValues); (yyval.insert_stmt)->tableName = (yyvsp[-5].sval); (yyval.insert_stmt)->columns = (yyvsp[-4].str_vec); (yyval.insert_stmt)->values = (yyvsp[-1].expr_vec); } -#line 2853 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2879 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 47: -#line 468 "bison_parser.y" /* yacc.c:1646 */ + case 50: +#line 489 "bison_parser.y" /* yacc.c:1646 */ { (yyval.insert_stmt) = new InsertStatement(kInsertSelect); (yyval.insert_stmt)->tableName = (yyvsp[-2].sval); (yyval.insert_stmt)->columns = (yyvsp[-1].str_vec); (yyval.insert_stmt)->select = (yyvsp[0].select_stmt); } -#line 2864 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2890 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 48: -#line 478 "bison_parser.y" /* yacc.c:1646 */ + case 51: +#line 499 "bison_parser.y" /* yacc.c:1646 */ { (yyval.str_vec) = (yyvsp[-1].str_vec); } -#line 2870 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2896 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 49: -#line 479 "bison_parser.y" /* yacc.c:1646 */ + case 52: +#line 500 "bison_parser.y" /* yacc.c:1646 */ { (yyval.str_vec) = nullptr; } -#line 2876 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2902 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 50: -#line 489 "bison_parser.y" /* yacc.c:1646 */ + case 53: +#line 510 "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 2887 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2913 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 51: -#line 498 "bison_parser.y" /* yacc.c:1646 */ + case 54: +#line 519 "bison_parser.y" /* yacc.c:1646 */ { (yyval.update_vec) = new std::vector(); (yyval.update_vec)->push_back((yyvsp[0].update_t)); } -#line 2893 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2919 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 52: -#line 499 "bison_parser.y" /* yacc.c:1646 */ + case 55: +#line 520 "bison_parser.y" /* yacc.c:1646 */ { (yyvsp[-2].update_vec)->push_back((yyvsp[0].update_t)); (yyval.update_vec) = (yyvsp[-2].update_vec); } -#line 2899 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2925 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 53: -#line 503 "bison_parser.y" /* yacc.c:1646 */ + case 56: +#line 524 "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 2909 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2935 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 56: -#line 517 "bison_parser.y" /* yacc.c:1646 */ + case 59: +#line 538 "bison_parser.y" /* yacc.c:1646 */ { // TODO: allow multiple unions (through linked list) // TODO: capture type of set_operator @@ -2924,23 +2950,23 @@ yyreduce: (yyval.select_stmt)->limit = (yyvsp[0].limit); } } -#line 2928 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2954 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 57: -#line 534 "bison_parser.y" /* yacc.c:1646 */ + case 60: +#line 555 "bison_parser.y" /* yacc.c:1646 */ { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } -#line 2934 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 58: -#line 535 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } -#line 2940 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2960 "bison_parser.cpp" /* yacc.c:1646 */ break; case 61: -#line 544 "bison_parser.y" /* yacc.c:1646 */ +#line 556 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } +#line 2966 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 64: +#line 565 "bison_parser.y" /* yacc.c:1646 */ { (yyval.select_stmt) = (yyvsp[-2].select_stmt); (yyval.select_stmt)->order = (yyvsp[-1].order_vec); @@ -2951,11 +2977,11 @@ yyreduce: (yyval.select_stmt)->limit = (yyvsp[0].limit); } } -#line 2955 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2981 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 62: -#line 554 "bison_parser.y" /* yacc.c:1646 */ + case 65: +#line 575 "bison_parser.y" /* yacc.c:1646 */ { // TODO: allow multiple unions (through linked list) // TODO: capture type of set_operator @@ -2970,11 +2996,11 @@ yyreduce: (yyval.select_stmt)->limit = (yyvsp[0].limit); } } -#line 2974 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3000 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 69: -#line 586 "bison_parser.y" /* yacc.c:1646 */ + case 72: +#line 607 "bison_parser.y" /* yacc.c:1646 */ { (yyval.select_stmt) = new SelectStatement(); (yyval.select_stmt)->limit = (yyvsp[-5].limit); @@ -2984,538 +3010,538 @@ yyreduce: (yyval.select_stmt)->whereClause = (yyvsp[-1].expr); (yyval.select_stmt)->groupBy = (yyvsp[0].group_t); } -#line 2988 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 70: -#line 598 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.bval) = true; } -#line 2994 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 71: -#line 599 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.bval) = false; } -#line 3000 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3014 "bison_parser.cpp" /* yacc.c:1646 */ break; case 73: -#line 607 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.table) = (yyvsp[0].table); } -#line 3006 "bison_parser.cpp" /* yacc.c:1646 */ +#line 619 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.bval) = true; } +#line 3020 "bison_parser.cpp" /* yacc.c:1646 */ break; case 74: -#line 612 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = (yyvsp[0].expr); } -#line 3012 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 75: -#line 613 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = nullptr; } -#line 3018 "bison_parser.cpp" /* yacc.c:1646 */ +#line 620 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.bval) = false; } +#line 3026 "bison_parser.cpp" /* yacc.c:1646 */ break; case 76: -#line 617 "bison_parser.y" /* yacc.c:1646 */ +#line 628 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.table) = (yyvsp[0].table); } +#line 3032 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 77: +#line 633 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = (yyvsp[0].expr); } +#line 3038 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 78: +#line 634 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = nullptr; } +#line 3044 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 79: +#line 638 "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 3028 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 77: -#line 622 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.group_t) = nullptr; } -#line 3034 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 78: -#line 626 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = (yyvsp[0].expr); } -#line 3040 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 79: -#line 627 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = nullptr; } -#line 3046 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3054 "bison_parser.cpp" /* yacc.c:1646 */ break; case 80: -#line 630 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.order_vec) = (yyvsp[0].order_vec); } -#line 3052 "bison_parser.cpp" /* yacc.c:1646 */ +#line 643 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.group_t) = nullptr; } +#line 3060 "bison_parser.cpp" /* yacc.c:1646 */ break; case 81: -#line 631 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.order_vec) = nullptr; } -#line 3058 "bison_parser.cpp" /* yacc.c:1646 */ +#line 647 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = (yyvsp[0].expr); } +#line 3066 "bison_parser.cpp" /* yacc.c:1646 */ break; case 82: -#line 635 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.order_vec) = new std::vector(); (yyval.order_vec)->push_back((yyvsp[0].order)); } -#line 3064 "bison_parser.cpp" /* yacc.c:1646 */ +#line 648 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = nullptr; } +#line 3072 "bison_parser.cpp" /* yacc.c:1646 */ break; case 83: -#line 636 "bison_parser.y" /* yacc.c:1646 */ - { (yyvsp[-2].order_vec)->push_back((yyvsp[0].order)); (yyval.order_vec) = (yyvsp[-2].order_vec); } -#line 3070 "bison_parser.cpp" /* yacc.c:1646 */ +#line 651 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.order_vec) = (yyvsp[0].order_vec); } +#line 3078 "bison_parser.cpp" /* yacc.c:1646 */ break; case 84: -#line 640 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.order) = new OrderDescription((yyvsp[0].order_type), (yyvsp[-1].expr)); } -#line 3076 "bison_parser.cpp" /* yacc.c:1646 */ +#line 652 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.order_vec) = nullptr; } +#line 3084 "bison_parser.cpp" /* yacc.c:1646 */ break; case 85: -#line 644 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.order_type) = kOrderAsc; } -#line 3082 "bison_parser.cpp" /* yacc.c:1646 */ +#line 656 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.order_vec) = new std::vector(); (yyval.order_vec)->push_back((yyvsp[0].order)); } +#line 3090 "bison_parser.cpp" /* yacc.c:1646 */ break; case 86: -#line 645 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.order_type) = kOrderDesc; } -#line 3088 "bison_parser.cpp" /* yacc.c:1646 */ +#line 657 "bison_parser.y" /* yacc.c:1646 */ + { (yyvsp[-2].order_vec)->push_back((yyvsp[0].order)); (yyval.order_vec) = (yyvsp[-2].order_vec); } +#line 3096 "bison_parser.cpp" /* yacc.c:1646 */ break; case 87: -#line 646 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.order_type) = kOrderAsc; } -#line 3094 "bison_parser.cpp" /* yacc.c:1646 */ +#line 661 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.order) = new OrderDescription((yyvsp[0].order_type), (yyvsp[-1].expr)); } +#line 3102 "bison_parser.cpp" /* yacc.c:1646 */ break; case 88: -#line 652 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.limit) = new LimitDescription((yyvsp[0].expr)->ival, kNoOffset); delete (yyvsp[0].expr); } -#line 3100 "bison_parser.cpp" /* yacc.c:1646 */ +#line 665 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.order_type) = kOrderAsc; } +#line 3108 "bison_parser.cpp" /* yacc.c:1646 */ break; case 89: -#line 653 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.limit) = nullptr; } -#line 3106 "bison_parser.cpp" /* yacc.c:1646 */ +#line 666 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.order_type) = kOrderDesc; } +#line 3114 "bison_parser.cpp" /* yacc.c:1646 */ break; case 90: -#line 657 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.limit) = new LimitDescription((yyvsp[0].expr)->ival, kNoOffset); delete (yyvsp[0].expr); } -#line 3112 "bison_parser.cpp" /* yacc.c:1646 */ +#line 667 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.order_type) = kOrderAsc; } +#line 3120 "bison_parser.cpp" /* yacc.c:1646 */ break; case 91: -#line 658 "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 3118 "bison_parser.cpp" /* yacc.c:1646 */ +#line 673 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.limit) = new LimitDescription((yyvsp[0].expr)->ival, kNoOffset); delete (yyvsp[0].expr); } +#line 3126 "bison_parser.cpp" /* yacc.c:1646 */ break; case 92: -#line 659 "bison_parser.y" /* yacc.c:1646 */ +#line 674 "bison_parser.y" /* yacc.c:1646 */ { (yyval.limit) = nullptr; } -#line 3124 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3132 "bison_parser.cpp" /* yacc.c:1646 */ break; case 93: -#line 666 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } -#line 3130 "bison_parser.cpp" /* yacc.c:1646 */ +#line 678 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.limit) = new LimitDescription((yyvsp[0].expr)->ival, kNoOffset); delete (yyvsp[0].expr); } +#line 3138 "bison_parser.cpp" /* yacc.c:1646 */ break; case 94: -#line 667 "bison_parser.y" /* yacc.c:1646 */ - { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } -#line 3136 "bison_parser.cpp" /* yacc.c:1646 */ +#line 679 "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 3144 "bison_parser.cpp" /* yacc.c:1646 */ break; case 95: -#line 671 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } -#line 3142 "bison_parser.cpp" /* yacc.c:1646 */ +#line 680 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.limit) = nullptr; } +#line 3150 "bison_parser.cpp" /* yacc.c:1646 */ break; case 96: -#line 672 "bison_parser.y" /* yacc.c:1646 */ - { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } -#line 3148 "bison_parser.cpp" /* yacc.c:1646 */ +#line 687 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } +#line 3156 "bison_parser.cpp" /* yacc.c:1646 */ break; case 97: -#line 676 "bison_parser.y" /* yacc.c:1646 */ +#line 688 "bison_parser.y" /* yacc.c:1646 */ + { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } +#line 3162 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 98: +#line 692 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } +#line 3168 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 99: +#line 693 "bison_parser.y" /* yacc.c:1646 */ + { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } +#line 3174 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 100: +#line 697 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[-1].expr); (yyval.expr)->alias = (yyvsp[0].sval); } -#line 3157 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3183 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 103: -#line 691 "bison_parser.y" /* yacc.c:1646 */ + case 106: +#line 712 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[-1].expr); } -#line 3163 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 111: -#line 699 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeSelect((yyvsp[-1].select_stmt)); } -#line 3169 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3189 "bison_parser.cpp" /* yacc.c:1646 */ break; case 114: -#line 708 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpUnary(kOpUnaryMinus, (yyvsp[0].expr)); } -#line 3175 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 115: -#line 709 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpUnary(kOpNot, (yyvsp[0].expr)); } -#line 3181 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 116: -#line 710 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-1].expr)); } -#line 3187 "bison_parser.cpp" /* yacc.c:1646 */ +#line 720 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeSelect((yyvsp[-1].select_stmt)); } +#line 3195 "bison_parser.cpp" /* yacc.c:1646 */ break; case 117: -#line 711 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-2].expr)); } -#line 3193 "bison_parser.cpp" /* yacc.c:1646 */ +#line 729 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpUnary(kOpUnaryMinus, (yyvsp[0].expr)); } +#line 3201 "bison_parser.cpp" /* yacc.c:1646 */ break; case 118: -#line 712 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeOpUnary(kOpIsNull, (yyvsp[-3].expr))); } -#line 3199 "bison_parser.cpp" /* yacc.c:1646 */ +#line 730 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpUnary(kOpNot, (yyvsp[0].expr)); } +#line 3207 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 119: +#line 731 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-1].expr)); } +#line 3213 "bison_parser.cpp" /* yacc.c:1646 */ break; case 120: -#line 717 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpMinus, (yyvsp[0].expr)); } -#line 3205 "bison_parser.cpp" /* yacc.c:1646 */ +#line 732 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-2].expr)); } +#line 3219 "bison_parser.cpp" /* yacc.c:1646 */ break; case 121: -#line 718 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPlus, (yyvsp[0].expr)); } -#line 3211 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 122: -#line 719 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpSlash, (yyvsp[0].expr)); } -#line 3217 "bison_parser.cpp" /* yacc.c:1646 */ +#line 733 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeOpUnary(kOpIsNull, (yyvsp[-3].expr))); } +#line 3225 "bison_parser.cpp" /* yacc.c:1646 */ break; case 123: -#line 720 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAsterisk, (yyvsp[0].expr)); } -#line 3223 "bison_parser.cpp" /* yacc.c:1646 */ +#line 738 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpMinus, (yyvsp[0].expr)); } +#line 3231 "bison_parser.cpp" /* yacc.c:1646 */ break; case 124: -#line 721 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPercentage, (yyvsp[0].expr)); } -#line 3229 "bison_parser.cpp" /* yacc.c:1646 */ +#line 739 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPlus, (yyvsp[0].expr)); } +#line 3237 "bison_parser.cpp" /* yacc.c:1646 */ break; case 125: -#line 722 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpCaret, (yyvsp[0].expr)); } -#line 3235 "bison_parser.cpp" /* yacc.c:1646 */ +#line 740 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpSlash, (yyvsp[0].expr)); } +#line 3243 "bison_parser.cpp" /* yacc.c:1646 */ break; case 126: -#line 723 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLike, (yyvsp[0].expr)); } -#line 3241 "bison_parser.cpp" /* yacc.c:1646 */ +#line 741 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAsterisk, (yyvsp[0].expr)); } +#line 3249 "bison_parser.cpp" /* yacc.c:1646 */ break; case 127: -#line 724 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-3].expr), kOpNotLike, (yyvsp[0].expr)); } -#line 3247 "bison_parser.cpp" /* yacc.c:1646 */ +#line 742 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPercentage, (yyvsp[0].expr)); } +#line 3255 "bison_parser.cpp" /* yacc.c:1646 */ break; case 128: -#line 725 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpILike, (yyvsp[0].expr)); } -#line 3253 "bison_parser.cpp" /* yacc.c:1646 */ +#line 743 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpCaret, (yyvsp[0].expr)); } +#line 3261 "bison_parser.cpp" /* yacc.c:1646 */ break; case 129: -#line 726 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpConcat, (yyvsp[0].expr)); } -#line 3259 "bison_parser.cpp" /* yacc.c:1646 */ +#line 744 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLike, (yyvsp[0].expr)); } +#line 3267 "bison_parser.cpp" /* yacc.c:1646 */ break; case 130: -#line 730 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAnd, (yyvsp[0].expr)); } -#line 3265 "bison_parser.cpp" /* yacc.c:1646 */ +#line 745 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-3].expr), kOpNotLike, (yyvsp[0].expr)); } +#line 3273 "bison_parser.cpp" /* yacc.c:1646 */ break; case 131: -#line 731 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpOr, (yyvsp[0].expr)); } -#line 3271 "bison_parser.cpp" /* yacc.c:1646 */ +#line 746 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpILike, (yyvsp[0].expr)); } +#line 3279 "bison_parser.cpp" /* yacc.c:1646 */ break; case 132: -#line 735 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].expr_vec)); } -#line 3277 "bison_parser.cpp" /* yacc.c:1646 */ +#line 747 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpConcat, (yyvsp[0].expr)); } +#line 3285 "bison_parser.cpp" /* yacc.c:1646 */ break; case 133: -#line 736 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].expr_vec))); } -#line 3283 "bison_parser.cpp" /* yacc.c:1646 */ +#line 751 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAnd, (yyvsp[0].expr)); } +#line 3291 "bison_parser.cpp" /* yacc.c:1646 */ break; case 134: -#line 737 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].select_stmt)); } -#line 3289 "bison_parser.cpp" /* yacc.c:1646 */ +#line 752 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpOr, (yyvsp[0].expr)); } +#line 3297 "bison_parser.cpp" /* yacc.c:1646 */ break; case 135: -#line 738 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].select_stmt))); } -#line 3295 "bison_parser.cpp" /* yacc.c:1646 */ +#line 756 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].expr_vec)); } +#line 3303 "bison_parser.cpp" /* yacc.c:1646 */ break; case 136: -#line 743 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeCase((yyvsp[-3].expr), (yyvsp[-1].expr)); } -#line 3301 "bison_parser.cpp" /* yacc.c:1646 */ +#line 757 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].expr_vec))); } +#line 3309 "bison_parser.cpp" /* yacc.c:1646 */ break; case 137: -#line 745 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeCase((yyvsp[-5].expr), (yyvsp[-3].expr), (yyvsp[-1].expr)); } -#line 3307 "bison_parser.cpp" /* yacc.c:1646 */ +#line 758 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].select_stmt)); } +#line 3315 "bison_parser.cpp" /* yacc.c:1646 */ break; case 138: -#line 749 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeExists((yyvsp[-1].select_stmt)); } -#line 3313 "bison_parser.cpp" /* yacc.c:1646 */ +#line 759 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].select_stmt))); } +#line 3321 "bison_parser.cpp" /* yacc.c:1646 */ break; case 139: -#line 750 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeExists((yyvsp[-1].select_stmt))); } -#line 3319 "bison_parser.cpp" /* yacc.c:1646 */ +#line 764 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeCase((yyvsp[-3].expr), (yyvsp[-1].expr)); } +#line 3327 "bison_parser.cpp" /* yacc.c:1646 */ break; case 140: -#line 754 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpEquals, (yyvsp[0].expr)); } -#line 3325 "bison_parser.cpp" /* yacc.c:1646 */ +#line 766 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeCase((yyvsp[-5].expr), (yyvsp[-3].expr), (yyvsp[-1].expr)); } +#line 3333 "bison_parser.cpp" /* yacc.c:1646 */ break; case 141: -#line 755 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpNotEquals, (yyvsp[0].expr)); } -#line 3331 "bison_parser.cpp" /* yacc.c:1646 */ +#line 770 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeExists((yyvsp[-1].select_stmt)); } +#line 3339 "bison_parser.cpp" /* yacc.c:1646 */ break; case 142: -#line 756 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLess, (yyvsp[0].expr)); } -#line 3337 "bison_parser.cpp" /* yacc.c:1646 */ +#line 771 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeExists((yyvsp[-1].select_stmt))); } +#line 3345 "bison_parser.cpp" /* yacc.c:1646 */ break; case 143: -#line 757 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreater, (yyvsp[0].expr)); } -#line 3343 "bison_parser.cpp" /* yacc.c:1646 */ +#line 775 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpEquals, (yyvsp[0].expr)); } +#line 3351 "bison_parser.cpp" /* yacc.c:1646 */ break; case 144: -#line 758 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLessEq, (yyvsp[0].expr)); } -#line 3349 "bison_parser.cpp" /* yacc.c:1646 */ +#line 776 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpNotEquals, (yyvsp[0].expr)); } +#line 3357 "bison_parser.cpp" /* yacc.c:1646 */ break; case 145: -#line 759 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreaterEq, (yyvsp[0].expr)); } -#line 3355 "bison_parser.cpp" /* yacc.c:1646 */ +#line 777 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLess, (yyvsp[0].expr)); } +#line 3363 "bison_parser.cpp" /* yacc.c:1646 */ break; case 146: -#line 763 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-2].sval), new std::vector(), false); } -#line 3361 "bison_parser.cpp" /* yacc.c:1646 */ +#line 778 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreater, (yyvsp[0].expr)); } +#line 3369 "bison_parser.cpp" /* yacc.c:1646 */ break; case 147: -#line 764 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-4].sval), (yyvsp[-1].expr_vec), (yyvsp[-2].bval)); } -#line 3367 "bison_parser.cpp" /* yacc.c:1646 */ +#line 779 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLessEq, (yyvsp[0].expr)); } +#line 3375 "bison_parser.cpp" /* yacc.c:1646 */ break; case 148: -#line 768 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeArray((yyvsp[-1].expr_vec)); } -#line 3373 "bison_parser.cpp" /* yacc.c:1646 */ +#line 780 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreaterEq, (yyvsp[0].expr)); } +#line 3381 "bison_parser.cpp" /* yacc.c:1646 */ break; case 149: -#line 772 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeArrayIndex((yyvsp[-3].expr), (yyvsp[-1].expr)->ival); } -#line 3379 "bison_parser.cpp" /* yacc.c:1646 */ +#line 784 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-2].sval), new std::vector(), false); } +#line 3387 "bison_parser.cpp" /* yacc.c:1646 */ break; case 150: -#line 776 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeBetween((yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 3385 "bison_parser.cpp" /* yacc.c:1646 */ +#line 785 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-4].sval), (yyvsp[-1].expr_vec), (yyvsp[-2].bval)); } +#line 3393 "bison_parser.cpp" /* yacc.c:1646 */ break; case 151: -#line 780 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeColumnRef((yyvsp[0].sval)); } -#line 3391 "bison_parser.cpp" /* yacc.c:1646 */ +#line 789 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeArray((yyvsp[-1].expr_vec)); } +#line 3399 "bison_parser.cpp" /* yacc.c:1646 */ break; case 152: -#line 781 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeColumnRef((yyvsp[-2].sval), (yyvsp[0].sval)); } -#line 3397 "bison_parser.cpp" /* yacc.c:1646 */ +#line 793 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeArrayIndex((yyvsp[-3].expr), (yyvsp[-1].expr)->ival); } +#line 3405 "bison_parser.cpp" /* yacc.c:1646 */ break; case 153: -#line 782 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeStar(); } -#line 3403 "bison_parser.cpp" /* yacc.c:1646 */ +#line 797 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeBetween((yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].expr)); } +#line 3411 "bison_parser.cpp" /* yacc.c:1646 */ break; case 154: -#line 783 "bison_parser.y" /* yacc.c:1646 */ +#line 801 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeColumnRef((yyvsp[0].sval)); } +#line 3417 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 155: +#line 802 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeColumnRef((yyvsp[-2].sval), (yyvsp[0].sval)); } +#line 3423 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 156: +#line 803 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeStar(); } +#line 3429 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 157: +#line 804 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeStar((yyvsp[-2].sval)); } -#line 3409 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 159: -#line 794 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeLiteral((yyvsp[0].sval)); } -#line 3415 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 160: -#line 799 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeLiteral((yyvsp[0].fval)); } -#line 3421 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3435 "bison_parser.cpp" /* yacc.c:1646 */ break; case 162: -#line 804 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeLiteral((yyvsp[0].ival)); } -#line 3427 "bison_parser.cpp" /* yacc.c:1646 */ +#line 815 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeLiteral((yyvsp[0].sval)); } +#line 3441 "bison_parser.cpp" /* yacc.c:1646 */ break; case 163: -#line 808 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeNullLiteral(); } -#line 3433 "bison_parser.cpp" /* yacc.c:1646 */ +#line 820 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeLiteral((yyvsp[0].fval)); } +#line 3447 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 164: -#line 812 "bison_parser.y" /* yacc.c:1646 */ + case 165: +#line 825 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeLiteral((yyvsp[0].ival)); } +#line 3453 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 166: +#line 829 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeNullLiteral(); } +#line 3459 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 167: +#line 833 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeParameter(yylloc.total_column); (yyval.expr)->ival2 = yyloc.param_list.size(); yyloc.param_list.push_back((yyval.expr)); } -#line 3443 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3469 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 166: -#line 825 "bison_parser.y" /* yacc.c:1646 */ + case 169: +#line 846 "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 3454 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3480 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 170: -#line 841 "bison_parser.y" /* yacc.c:1646 */ + case 173: +#line 862 "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 3465 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3491 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 171: -#line 850 "bison_parser.y" /* yacc.c:1646 */ + case 174: +#line 871 "bison_parser.y" /* yacc.c:1646 */ { (yyval.table_vec) = new std::vector(); (yyval.table_vec)->push_back((yyvsp[0].table)); } -#line 3471 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3497 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 172: -#line 851 "bison_parser.y" /* yacc.c:1646 */ + case 175: +#line 872 "bison_parser.y" /* yacc.c:1646 */ { (yyvsp[-2].table_vec)->push_back((yyvsp[0].table)); (yyval.table_vec) = (yyvsp[-2].table_vec); } -#line 3477 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3503 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 173: -#line 856 "bison_parser.y" /* yacc.c:1646 */ + case 176: +#line 877 "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 3488 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3514 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 174: -#line 866 "bison_parser.y" /* yacc.c:1646 */ + case 177: +#line 887 "bison_parser.y" /* yacc.c:1646 */ { (yyval.table) = new TableRef(kTableName); (yyval.table)->name = (yyvsp[0].sval); } -#line 3497 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3523 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 176: -#line 875 "bison_parser.y" /* yacc.c:1646 */ + case 179: +#line 896 "bison_parser.y" /* yacc.c:1646 */ { (yyval.sval) = (yyvsp[0].sval); } -#line 3503 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 177: -#line 880 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.sval) = (yyvsp[0].sval); } -#line 3509 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3529 "bison_parser.cpp" /* yacc.c:1646 */ break; case 180: -#line 886 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.sval) = nullptr; } -#line 3515 "bison_parser.cpp" /* yacc.c:1646 */ +#line 901 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.sval) = (yyvsp[0].sval); } +#line 3535 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 181: -#line 895 "bison_parser.y" /* yacc.c:1646 */ + case 183: +#line 907 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.sval) = nullptr; } +#line 3541 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 184: +#line 916 "bison_parser.y" /* yacc.c:1646 */ { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); @@ -3523,12 +3549,12 @@ yyreduce: (yyval.table)->join->left = (yyvsp[-3].table); (yyval.table)->join->right = (yyvsp[0].table); } -#line 3527 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3553 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 182: -#line 903 "bison_parser.y" /* yacc.c:1646 */ - { + case 185: +#line 924 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); (yyval.table)->join->type = (JoinType) (yyvsp[-4].uval); @@ -3536,12 +3562,12 @@ yyreduce: (yyval.table)->join->right = (yyvsp[-2].table); (yyval.table)->join->condition = (yyvsp[0].expr); } -#line 3540 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3566 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 183: -#line 913 "bison_parser.y" /* yacc.c:1646 */ - { + case 186: +#line 934 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); (yyval.table)->join->type = (JoinType) (yyvsp[-6].uval); @@ -3556,71 +3582,71 @@ yyreduce: (yyval.table)->join->condition = Expr::makeOpBinary(left_col, kOpEquals, right_col); delete (yyvsp[-1].expr); } -#line 3560 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 184: -#line 931 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = kJoinInner; } -#line 3566 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 185: -#line 932 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = kJoinOuter; } -#line 3572 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 186: -#line 933 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = kJoinLeftOuter; } -#line 3578 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3586 "bison_parser.cpp" /* yacc.c:1646 */ break; case 187: -#line 934 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = kJoinRightOuter; } -#line 3584 "bison_parser.cpp" /* yacc.c:1646 */ +#line 952 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinInner; } +#line 3592 "bison_parser.cpp" /* yacc.c:1646 */ break; case 188: -#line 935 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = kJoinLeft; } -#line 3590 "bison_parser.cpp" /* yacc.c:1646 */ +#line 953 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinOuter; } +#line 3598 "bison_parser.cpp" /* yacc.c:1646 */ break; case 189: -#line 936 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = kJoinRight; } -#line 3596 "bison_parser.cpp" /* yacc.c:1646 */ +#line 954 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinLeftOuter; } +#line 3604 "bison_parser.cpp" /* yacc.c:1646 */ break; case 190: -#line 937 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = kJoinCross; } -#line 3602 "bison_parser.cpp" /* yacc.c:1646 */ +#line 955 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinRightOuter; } +#line 3610 "bison_parser.cpp" /* yacc.c:1646 */ break; case 191: -#line 938 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = kJoinInner; } -#line 3608 "bison_parser.cpp" /* yacc.c:1646 */ +#line 956 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinLeft; } +#line 3616 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 195: + case 192: +#line 957 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinRight; } +#line 3622 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 193: #line 958 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.str_vec) = new std::vector(); (yyval.str_vec)->push_back((yyvsp[0].sval)); } -#line 3614 "bison_parser.cpp" /* yacc.c:1646 */ + { (yyval.uval) = kJoinCross; } +#line 3628 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 196: + case 194: #line 959 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinInner; } +#line 3634 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 198: +#line 979 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.str_vec) = new std::vector(); (yyval.str_vec)->push_back((yyvsp[0].sval)); } +#line 3640 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 199: +#line 980 "bison_parser.y" /* yacc.c:1646 */ { (yyvsp[-2].str_vec)->push_back((yyvsp[0].sval)); (yyval.str_vec) = (yyvsp[-2].str_vec); } -#line 3620 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3646 "bison_parser.cpp" /* yacc.c:1646 */ break; -#line 3624 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3650 "bison_parser.cpp" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -3855,7 +3881,7 @@ yyreturn: #endif return yyresult; } -#line 962 "bison_parser.y" /* yacc.c:1906 */ +#line 983 "bison_parser.y" /* yacc.c:1906 */ /********************************* ** Section 4: Additional C code diff --git a/src/parser/bison_parser.h b/src/parser/bison_parser.h index e203b32..8a5d89d 100644 --- a/src/parser/bison_parser.h +++ b/src/parser/bison_parser.h @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.0.4. */ +/* A Bison parser, made by GNU Bison 3.0.2. */ /* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. + 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 @@ -214,7 +214,7 @@ extern int hsql_debug; /* Value type. */ #if ! defined HSQL_STYPE && ! defined HSQL_STYPE_IS_DECLARED - +typedef union HSQL_STYPE HSQL_STYPE; union HSQL_STYPE { #line 93 "bison_parser.y" /* yacc.c:1909 */ @@ -235,6 +235,7 @@ union HSQL_STYPE hsql::DropStatement* drop_stmt; hsql::PrepareStatement* prep_stmt; hsql::ExecuteStatement* exec_stmt; + hsql::ShowStatement* show_stmt; hsql::TableRef* table; hsql::Expr* expr; @@ -254,10 +255,8 @@ union HSQL_STYPE std::vector* expr_vec; std::vector* order_vec; -#line 258 "bison_parser.h" /* yacc.c:1909 */ +#line 259 "bison_parser.h" /* yacc.c:1909 */ }; - -typedef union HSQL_STYPE HSQL_STYPE; # define HSQL_STYPE_IS_TRIVIAL 1 # define HSQL_STYPE_IS_DECLARED 1 #endif diff --git a/src/parser/bison_parser.y b/src/parser/bison_parser.y index bb96826..d498bb3 100644 --- a/src/parser/bison_parser.y +++ b/src/parser/bison_parser.y @@ -107,6 +107,7 @@ int yyerror(YYLTYPE* llocp, SQLParserResult* result, yyscan_t scanner, const cha hsql::DropStatement* drop_stmt; hsql::PrepareStatement* prep_stmt; hsql::ExecuteStatement* exec_stmt; + hsql::ShowStatement* show_stmt; hsql::TableRef* table; hsql::Expr* expr; @@ -182,6 +183,7 @@ int yyerror(YYLTYPE* llocp, SQLParserResult* result, yyscan_t scanner, const cha %type delete_statement truncate_statement %type update_statement %type drop_statement +%type show_statement %type table_name opt_alias alias file_path prepare_target_query %type opt_not_exists opt_distinct %type import_file_type opt_join_type column_type @@ -271,6 +273,9 @@ statement: $$ = $1; $$->hints = $2; } + | show_statement { + $$ = $1; + } ; @@ -361,6 +366,22 @@ file_path: ; +/****************************** + * Show Statement + * SHOW TABLES; + ******************************/ + +show_statement: + SHOW TABLES { + $$ = new ShowStatement(kShowTables); + } + | SHOW COLUMNS table_name { + $$ = new ShowStatement(kShowColumns); + $$->name = $3; + } + ; + + /****************************** * Create Statement * CREATE TABLE students (name TEXT, student_number INTEGER, city TEXT, grade DOUBLE) @@ -836,7 +857,7 @@ table_ref_atomic: | join_clause ; -nonjoin_table_ref_atomic: +nonjoin_table_ref_atomic: table_ref_name | '(' select_statement ')' opt_alias { auto tbl = new TableRef(kTableSelect); @@ -900,7 +921,7 @@ join_clause: $$->join->right = $4; } | table_ref_atomic opt_join_type JOIN table_ref_atomic ON join_condition - { + { $$ = new TableRef(kTableJoin); $$->join = new JoinDefinition(); $$->join->type = (JoinType) $2; @@ -910,7 +931,7 @@ join_clause: } | table_ref_atomic opt_join_type JOIN table_ref_atomic USING '(' column_name ')' - { + { $$ = new TableRef(kTableJoin); $$->join = new JoinDefinition(); $$->join->type = (JoinType) $2; diff --git a/src/parser/flex_lexer.cpp b/src/parser/flex_lexer.cpp index ceb87e2..2af46f3 100644 --- a/src/parser/flex_lexer.cpp +++ b/src/parser/flex_lexer.cpp @@ -1,6 +1,6 @@ -#line 1 "flex_lexer.cpp" +#line 2 "flex_lexer.cpp" -#line 3 "flex_lexer.cpp" +#line 4 "flex_lexer.cpp" #define YY_INT_ALIGNED short int @@ -8,246 +8,12 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 4 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif -#ifdef yy_create_buffer -#define hsql__create_buffer_ALREADY_DEFINED -#else -#define yy_create_buffer hsql__create_buffer -#endif - -#ifdef yy_delete_buffer -#define hsql__delete_buffer_ALREADY_DEFINED -#else -#define yy_delete_buffer hsql__delete_buffer -#endif - -#ifdef yy_scan_buffer -#define hsql__scan_buffer_ALREADY_DEFINED -#else -#define yy_scan_buffer hsql__scan_buffer -#endif - -#ifdef yy_scan_string -#define hsql__scan_string_ALREADY_DEFINED -#else -#define yy_scan_string hsql__scan_string -#endif - -#ifdef yy_scan_bytes -#define hsql__scan_bytes_ALREADY_DEFINED -#else -#define yy_scan_bytes hsql__scan_bytes -#endif - -#ifdef yy_init_buffer -#define hsql__init_buffer_ALREADY_DEFINED -#else -#define yy_init_buffer hsql__init_buffer -#endif - -#ifdef yy_flush_buffer -#define hsql__flush_buffer_ALREADY_DEFINED -#else -#define yy_flush_buffer hsql__flush_buffer -#endif - -#ifdef yy_load_buffer_state -#define hsql__load_buffer_state_ALREADY_DEFINED -#else -#define yy_load_buffer_state hsql__load_buffer_state -#endif - -#ifdef yy_switch_to_buffer -#define hsql__switch_to_buffer_ALREADY_DEFINED -#else -#define yy_switch_to_buffer hsql__switch_to_buffer -#endif - -#ifdef yypush_buffer_state -#define hsql_push_buffer_state_ALREADY_DEFINED -#else -#define yypush_buffer_state hsql_push_buffer_state -#endif - -#ifdef yypop_buffer_state -#define hsql_pop_buffer_state_ALREADY_DEFINED -#else -#define yypop_buffer_state hsql_pop_buffer_state -#endif - -#ifdef yyensure_buffer_stack -#define hsql_ensure_buffer_stack_ALREADY_DEFINED -#else -#define yyensure_buffer_stack hsql_ensure_buffer_stack -#endif - -#ifdef yylex -#define hsql_lex_ALREADY_DEFINED -#else -#define yylex hsql_lex -#endif - -#ifdef yyrestart -#define hsql_restart_ALREADY_DEFINED -#else -#define yyrestart hsql_restart -#endif - -#ifdef yylex_init -#define hsql_lex_init_ALREADY_DEFINED -#else -#define yylex_init hsql_lex_init -#endif - -#ifdef yylex_init_extra -#define hsql_lex_init_extra_ALREADY_DEFINED -#else -#define yylex_init_extra hsql_lex_init_extra -#endif - -#ifdef yylex_destroy -#define hsql_lex_destroy_ALREADY_DEFINED -#else -#define yylex_destroy hsql_lex_destroy -#endif - -#ifdef yyget_debug -#define hsql_get_debug_ALREADY_DEFINED -#else -#define yyget_debug hsql_get_debug -#endif - -#ifdef yyset_debug -#define hsql_set_debug_ALREADY_DEFINED -#else -#define yyset_debug hsql_set_debug -#endif - -#ifdef yyget_extra -#define hsql_get_extra_ALREADY_DEFINED -#else -#define yyget_extra hsql_get_extra -#endif - -#ifdef yyset_extra -#define hsql_set_extra_ALREADY_DEFINED -#else -#define yyset_extra hsql_set_extra -#endif - -#ifdef yyget_in -#define hsql_get_in_ALREADY_DEFINED -#else -#define yyget_in hsql_get_in -#endif - -#ifdef yyset_in -#define hsql_set_in_ALREADY_DEFINED -#else -#define yyset_in hsql_set_in -#endif - -#ifdef yyget_out -#define hsql_get_out_ALREADY_DEFINED -#else -#define yyget_out hsql_get_out -#endif - -#ifdef yyset_out -#define hsql_set_out_ALREADY_DEFINED -#else -#define yyset_out hsql_set_out -#endif - -#ifdef yyget_leng -#define hsql_get_leng_ALREADY_DEFINED -#else -#define yyget_leng hsql_get_leng -#endif - -#ifdef yyget_text -#define hsql_get_text_ALREADY_DEFINED -#else -#define yyget_text hsql_get_text -#endif - -#ifdef yyget_lineno -#define hsql_get_lineno_ALREADY_DEFINED -#else -#define yyget_lineno hsql_get_lineno -#endif - -#ifdef yyset_lineno -#define hsql_set_lineno_ALREADY_DEFINED -#else -#define yyset_lineno hsql_set_lineno -#endif - -#ifdef yyget_column -#define hsql_get_column_ALREADY_DEFINED -#else -#define yyget_column hsql_get_column -#endif - -#ifdef yyset_column -#define hsql_set_column_ALREADY_DEFINED -#else -#define yyset_column hsql_set_column -#endif - -#ifdef yywrap -#define hsql_wrap_ALREADY_DEFINED -#else -#define yywrap hsql_wrap -#endif - -#ifdef yyget_lval -#define hsql_get_lval_ALREADY_DEFINED -#else -#define yyget_lval hsql_get_lval -#endif - -#ifdef yyset_lval -#define hsql_set_lval_ALREADY_DEFINED -#else -#define yyset_lval hsql_set_lval -#endif - -#ifdef yyget_lloc -#define hsql_get_lloc_ALREADY_DEFINED -#else -#define yyget_lloc hsql_get_lloc -#endif - -#ifdef yyset_lloc -#define hsql_set_lloc_ALREADY_DEFINED -#else -#define yyset_lloc hsql_set_lloc -#endif - -#ifdef yyalloc -#define hsql_alloc_ALREADY_DEFINED -#else -#define yyalloc hsql_alloc -#endif - -#ifdef yyrealloc -#define hsql_realloc_ALREADY_DEFINED -#else -#define yyrealloc hsql_realloc -#endif - -#ifdef yyfree -#define hsql_free_ALREADY_DEFINED -#else -#define yyfree hsql_free -#endif - /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ @@ -318,32 +84,40 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#ifndef SIZE_MAX -#define SIZE_MAX (~(size_t)0) -#endif - #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -/* begin standard C++ headers. */ +#ifdef __cplusplus -/* TODO: this is always defined, so inline it */ +/* 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 - -#if defined(__GNUC__) && __GNUC__ >= 3 -#define yynoreturn __attribute__((__noreturn__)) #else -#define yynoreturn +#define yyconst #endif /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an - * integer in range [0..255] for use as an array index. +/* 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) ((YY_CHAR) (c)) +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* An opaque pointer. */ #ifndef YY_TYPEDEF_YY_SCANNER_T @@ -367,16 +141,20 @@ typedef void* yyscan_t; * 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 yyrestart( yyin , yyscanner ) +#define YY_NEW_FILE hsql_restart(yyin ,yyscanner ) + #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ @@ -401,17 +179,11 @@ typedef void* yyscan_t; 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 - #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + #define YY_LESS_LINENO(n) - #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -426,8 +198,14 @@ typedef size_t yy_size_t; 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 @@ -440,7 +218,7 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - int yy_buf_size; + yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. @@ -468,7 +246,7 @@ struct yy_buffer_state 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. */ @@ -485,7 +263,7 @@ struct yy_buffer_state * possible backing-up. * * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by + * (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 @@ -502,77 +280,84 @@ struct yy_buffer_state #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 yyrestart ( FILE *input_file , yyscan_t yyscanner ); -void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); -YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); -void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); -void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); -void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); -void yypop_buffer_state ( yyscan_t yyscanner ); +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 yyensure_buffer_stack ( yyscan_t yyscanner ); -static void yy_load_buffer_state ( yyscan_t yyscanner ); -static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); -#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , 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 ); -YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); +#define YY_FLUSH_BUFFER hsql__flush_buffer(YY_CURRENT_BUFFER ,yyscanner) -void *yyalloc ( yy_size_t , yyscan_t yyscanner ); -void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); -void yyfree ( void * , 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 ); + +#define yy_new_buffer hsql__create_buffer -#define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ - yyensure_buffer_stack (yyscanner); \ + hsql_ensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + 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 ){\ - yyensure_buffer_stack (yyscanner); \ + hsql_ensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + 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(yyscanner) (/*CONSTCOND*/1) +#define hsql_wrap(n) 1 #define YY_SKIP_YYWRAP -typedef flex_uint8_t YY_CHAR; + +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 yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); +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 = (int) (yy_cp - 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 136 #define YY_END_OF_BUFFER 137 /* This struct is not used in this scanner, @@ -582,7 +367,7 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static const flex_int16_t yy_accept[938] = +static yyconst flex_int16_t yy_accept[938] = { 0, 0, 0, 2, 2, 137, 135, 4, 4, 135, 135, 128, 135, 128, 128, 131, 128, 128, 133, 133, 133, @@ -689,7 +474,7 @@ static const flex_int16_t yy_accept[938] = 2, 2, 5, 6, 2, 2, 0 } ; -static const YY_CHAR yy_ec[256] = +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, @@ -721,7 +506,7 @@ static const YY_CHAR yy_ec[256] = 1, 1, 1, 1, 1 } ; -static const YY_CHAR yy_meta[68] = +static yyconst flex_int32_t yy_meta[68] = { 0, 1, 1, 2, 1, 3, 1, 1, 1, 1, 4, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, @@ -732,7 +517,7 @@ static const YY_CHAR yy_meta[68] = 4, 4, 4, 4, 4, 4, 1 } ; -static const flex_int16_t yy_base[945] = +static yyconst flex_int16_t yy_base[945] = { 0, 0, 0, 67, 0, 433, 3713, 133, 135, 418, 0, 3713, 410, 131, 401, 133, 132, 384, 129, 129, 137, @@ -840,7 +625,7 @@ static const flex_int16_t yy_base[945] = 3696, 3700, 3704, 3708 } ; -static const flex_int16_t yy_def[945] = +static yyconst flex_int16_t yy_def[945] = { 0, 937, 1, 937, 3, 937, 937, 937, 937, 937, 938, 937, 939, 937, 937, 937, 937, 937, 940, 940, 940, @@ -948,7 +733,7 @@ static const flex_int16_t yy_def[945] = 937, 937, 937, 937 } ; -static const flex_int16_t yy_nxt[3781] = +static yyconst flex_int16_t yy_nxt[3781] = { 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 11, 17, 18, 19, 20, 21, 22, 23, 24, @@ -1367,7 +1152,7 @@ static const flex_int16_t yy_nxt[3781] = 937, 937, 937, 937, 937, 937, 937, 937, 937, 937 } ; -static const flex_int16_t yy_chk[3781] = +static yyconst flex_int16_t yy_chk[3781] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -1810,7 +1595,6 @@ static const flex_int16_t yy_chk[3781] = #define TOKEN(name) { return SQL_##name; } -#line 1813 "flex_lexer.cpp" /*************************** ** Section 2: Rules ***************************/ @@ -1823,7 +1607,7 @@ static const flex_int16_t yy_chk[3781] = /*************************** ** Section 3: Rules ***************************/ -#line 1826 "flex_lexer.cpp" +#line 1611 "flex_lexer.cpp" #define INITIAL 0 #define COMMENT 1 @@ -1878,7 +1662,7 @@ struct yyguts_t }; /* end struct yyguts_t */ -static int yy_init_globals ( yyscan_t yyscanner ); +static int yy_init_globals (yyscan_t yyscanner ); /* This must go here because YYSTYPE and YYLTYPE are included * from bison output in section 1.*/ @@ -1886,50 +1670,46 @@ static int yy_init_globals ( yyscan_t yyscanner ); # define yylloc yyg->yylloc_r -int yylex_init (yyscan_t* scanner); +int hsql_lex_init (yyscan_t* scanner); -int yylex_init_extra ( YY_EXTRA_TYPE user_defined, 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 yylex_destroy ( yyscan_t yyscanner ); +int hsql_lex_destroy (yyscan_t yyscanner ); -int yyget_debug ( yyscan_t yyscanner ); +int hsql_get_debug (yyscan_t yyscanner ); -void yyset_debug ( int debug_flag , yyscan_t yyscanner ); +void hsql_set_debug (int debug_flag ,yyscan_t yyscanner ); -YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); +YY_EXTRA_TYPE hsql_get_extra (yyscan_t yyscanner ); -void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); +void hsql_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); -FILE *yyget_in ( yyscan_t yyscanner ); +FILE *hsql_get_in (yyscan_t yyscanner ); -void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); +void hsql_set_in (FILE * in_str ,yyscan_t yyscanner ); -FILE *yyget_out ( yyscan_t yyscanner ); +FILE *hsql_get_out (yyscan_t yyscanner ); -void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); +void hsql_set_out (FILE * out_str ,yyscan_t yyscanner ); - int yyget_leng ( yyscan_t yyscanner ); +int hsql_get_leng (yyscan_t yyscanner ); -char *yyget_text ( yyscan_t yyscanner ); +char *hsql_get_text (yyscan_t yyscanner ); -int yyget_lineno ( yyscan_t yyscanner ); +int hsql_get_lineno (yyscan_t yyscanner ); -void yyset_lineno ( int _line_number , yyscan_t yyscanner ); +void hsql_set_lineno (int line_number ,yyscan_t yyscanner ); -int yyget_column ( yyscan_t yyscanner ); +YYSTYPE * hsql_get_lval (yyscan_t yyscanner ); -void yyset_column ( int _column_no , yyscan_t yyscanner ); +void hsql_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); -YYSTYPE * yyget_lval ( yyscan_t yyscanner ); - -void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner ); - - YYLTYPE *yyget_lloc ( yyscan_t yyscanner ); + YYLTYPE *hsql_get_lloc (yyscan_t yyscanner ); - void yyset_lloc ( YYLTYPE * yylloc_param , 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. @@ -1937,29 +1717,26 @@ void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap ( yyscan_t yyscanner ); +extern "C" int hsql_wrap (yyscan_t yyscanner ); #else -extern int yywrap ( yyscan_t yyscanner ); +extern int hsql_wrap (yyscan_t yyscanner ); #endif #endif -#ifndef YY_NO_UNPUT - -#endif - #ifndef yytext_ptr -static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT + #ifdef __cplusplus -static int yyinput ( yyscan_t yyscanner ); +static int yyinput (yyscan_t yyscanner ); #else -static int input ( yyscan_t yyscanner ); +static int input (yyscan_t yyscanner ); #endif #endif @@ -1979,7 +1756,7 @@ static int input ( yyscan_t yyscanner ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) +#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, @@ -1990,7 +1767,7 @@ static int input ( yyscan_t yyscanner ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - int n; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -2003,7 +1780,7 @@ static int input ( yyscan_t yyscanner ); else \ { \ errno=0; \ - while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -2044,10 +1821,10 @@ static int input ( yyscan_t yyscanner ); #ifndef YY_DECL #define YY_DECL_IS_OURS 1 -extern int yylex \ - (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner); +extern int hsql_lex \ + (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner); -#define YY_DECL int yylex \ +#define YY_DECL int hsql_lex \ (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) #endif /* !YY_DECL */ @@ -2060,7 +1837,7 @@ extern int yylex \ /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK /*LINTED*/break; +#define YY_BREAK break; #endif #define YY_RULE_SETUP \ @@ -2070,11 +1847,16 @@ extern int yylex \ */ YY_DECL { - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; + 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 1859 "flex_lexer.cpp" + yylval = yylval_param; yylloc = yylloc_param; @@ -2097,21 +1879,15 @@ YY_DECL yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { - yyensure_buffer_stack (yyscanner); + hsql_ensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + hsql__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); } - yy_load_buffer_state( yyscanner ); + hsql__load_buffer_state(yyscanner ); } - { -#line 51 "flex_lexer.l" - - -#line 2112 "flex_lexer.cpp" - - while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = yyg->yy_c_buf_p; @@ -2127,7 +1903,7 @@ YY_DECL yy_match: do { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + 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; @@ -2137,9 +1913,9 @@ yy_match: { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 938 ) - yy_c = yy_meta[yy_c]; + yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_current_state != 937 ); @@ -2858,7 +2634,7 @@ YY_RULE_SETUP #line 217 "flex_lexer.l" ECHO; YY_BREAK -#line 2861 "flex_lexer.cpp" +#line 2638 "flex_lexer.cpp" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(COMMENT): yyterminate(); @@ -2877,7 +2653,7 @@ case YY_STATE_EOF(COMMENT): /* 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 - * yylex(). If so, then we have to assure + * 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 @@ -2938,7 +2714,7 @@ case YY_STATE_EOF(COMMENT): { yyg->yy_did_buffer_switch_on_eof = 0; - if ( yywrap( yyscanner ) ) + if ( hsql_wrap(yyscanner ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -2991,8 +2767,7 @@ case YY_STATE_EOF(COMMENT): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ - } /* end of user's declarations */ -} /* end of yylex */ +} /* end of hsql_lex */ /* yy_get_next_buffer - try to read in a new buffer * @@ -3004,9 +2779,9 @@ case YY_STATE_EOF(COMMENT): static int yy_get_next_buffer (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - char *source = yyg->yytext_ptr; - int number_to_move, i; + 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] ) @@ -3035,7 +2810,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* 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); + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -3055,7 +2830,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; int yy_c_buf_p_offset = (int) (yyg->yy_c_buf_p - b->yy_ch_buf); @@ -3071,12 +2846,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - yyrealloc( (void *) b->yy_ch_buf, - (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + 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 = NULL; + b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -3094,7 +2868,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - yyg->yy_n_chars, num_to_read ); + yyg->yy_n_chars, (size_t) num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } @@ -3104,7 +2878,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin , yyscanner); + hsql_restart(yyin ,yyscanner); } else @@ -3118,15 +2892,12 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + 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. */ - int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( - (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); + 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()" ); - /* "- 2" to take care of EOB's */ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } yyg->yy_n_chars += number_to_move; @@ -3142,15 +2913,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner) static yy_state_type yy_get_previous_state (yyscan_t yyscanner) { - yy_state_type yy_current_state; - char *yy_cp; + 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 ) { - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + 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; @@ -3160,9 +2931,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 938 ) - yy_c = yy_meta[yy_c]; + yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; @@ -3175,11 +2946,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) { - int yy_is_jam; + register int yy_is_jam; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ - char *yy_cp = yyg->yy_c_buf_p; + register char *yy_cp = yyg->yy_c_buf_p; - YY_CHAR yy_c = 1; + register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -3189,19 +2960,14 @@ static int yy_get_next_buffer (yyscan_t yyscanner) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 938 ) - yy_c = yy_meta[yy_c]; + yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 937); - (void)yyg; return yy_is_jam ? 0 : yy_current_state; } -#ifndef YY_NO_UNPUT - -#endif - #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (yyscan_t yyscanner) @@ -3227,7 +2993,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { /* need more input */ - int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); + int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; ++yyg->yy_c_buf_p; switch ( yy_get_next_buffer( yyscanner ) ) @@ -3244,14 +3010,14 @@ static int yy_get_next_buffer (yyscan_t yyscanner) */ /* Reset buffer status. */ - yyrestart( yyin , yyscanner); + hsql_restart(yyin ,yyscanner); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( yywrap( yyscanner ) ) - return 0; + if ( hsql_wrap(yyscanner ) ) + return EOF; if ( ! yyg->yy_did_buffer_switch_on_eof ) YY_NEW_FILE; @@ -3282,34 +3048,34 @@ static int yy_get_next_buffer (yyscan_t yyscanner) * @param yyscanner The scanner object. * @note This function does not reset the start condition to @c INITIAL . */ - void yyrestart (FILE * input_file , yyscan_t yyscanner) + void hsql_restart (FILE * input_file , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! YY_CURRENT_BUFFER ){ - yyensure_buffer_stack (yyscanner); + hsql_ensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + hsql__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); } - yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); - yy_load_buffer_state( 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 yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) + 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 - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); + * hsql_pop_buffer_state(); + * hsql_push_buffer_state(new_buffer); */ - yyensure_buffer_stack (yyscanner); + hsql_ensure_buffer_stack (yyscanner); if ( YY_CURRENT_BUFFER == new_buffer ) return; @@ -3322,17 +3088,17 @@ static int yy_get_next_buffer (yyscan_t yyscanner) } YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( yyscanner ); + hsql__load_buffer_state(yyscanner ); /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe + * 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 yy_load_buffer_state (yyscan_t yyscanner) +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; @@ -3347,35 +3113,35 @@ static void yy_load_buffer_state (yyscan_t yyscanner) * @param yyscanner The scanner object. * @return the allocated buffer state. */ - YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) + YY_BUFFER_STATE hsql__create_buffer (FILE * file, int size , yyscan_t yyscanner) { YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + b = (YY_BUFFER_STATE) hsql_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + 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 *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + 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 yy_create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in hsql__create_buffer()" ); b->yy_is_our_buffer = 1; - yy_init_buffer( b, file , yyscanner); + hsql__init_buffer(b,file ,yyscanner); return b; } /** Destroy the buffer. - * @param b a buffer created with yy_create_buffer() + * @param b a buffer created with hsql__create_buffer() * @param yyscanner The scanner object. */ - void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) + void hsql__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; @@ -3386,28 +3152,28 @@ static void yy_load_buffer_state (yyscan_t yyscanner) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yyfree( (void *) b->yy_ch_buf , yyscanner ); + hsql_free((void *) b->yy_ch_buf ,yyscanner ); - yyfree( (void *) b , 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 yyrestart() or at EOF. + * such as during a hsql_restart() or at EOF. */ - static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) + 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; - yy_flush_buffer( b , yyscanner); + hsql__flush_buffer(b ,yyscanner); b->yy_input_file = file; b->yy_fill_buffer = 1; - /* If b is the current buffer, then yy_init_buffer was _probably_ - * called from yyrestart() or through yy_get_next_buffer. + /* 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){ @@ -3424,7 +3190,7 @@ static void yy_load_buffer_state (yyscan_t yyscanner) * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * @param yyscanner The scanner object. */ - void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) + void hsql__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! b ) @@ -3445,7 +3211,7 @@ static void yy_load_buffer_state (yyscan_t yyscanner) b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( yyscanner ); + hsql__load_buffer_state(yyscanner ); } /** Pushes the new state onto the stack. The new state becomes @@ -3454,15 +3220,15 @@ static void yy_load_buffer_state (yyscan_t yyscanner) * @param new_buffer The new state. * @param yyscanner The scanner object. */ -void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +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; - yyensure_buffer_stack(yyscanner); + hsql_ensure_buffer_stack(yyscanner); - /* This block is copied from yy_switch_to_buffer. */ + /* This block is copied from hsql__switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ @@ -3476,8 +3242,8 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) yyg->yy_buffer_stack_top++; YY_CURRENT_BUFFER_LVALUE = new_buffer; - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( yyscanner ); + /* copied from hsql__switch_to_buffer. */ + hsql__load_buffer_state(yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } @@ -3485,19 +3251,19 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) * The next element becomes the new top. * @param yyscanner The scanner object. */ -void yypop_buffer_state (yyscan_t yyscanner) +void hsql_pop_buffer_state (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!YY_CURRENT_BUFFER) return; - yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); + 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) { - yy_load_buffer_state( yyscanner ); + hsql__load_buffer_state(yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } } @@ -3505,9 +3271,9 @@ void yypop_buffer_state (yyscan_t yyscanner) /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ -static void yyensure_buffer_stack (yyscan_t yyscanner) +static void hsql_ensure_buffer_stack (yyscan_t yyscanner) { - yy_size_t num_to_alloc; + int num_to_alloc; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!yyg->yy_buffer_stack) { @@ -3516,15 +3282,15 @@ static void yyensure_buffer_stack (yyscan_t yyscanner) * 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; /* After all that talk, this was set to 1 anyways... */ - yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc + 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 yyensure_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; @@ -3533,15 +3299,15 @@ static void yyensure_buffer_stack (yyscan_t yyscanner) if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ /* Increase the buffer to prepare for a possible push. */ - yy_size_t grow_size = 8 /* arbitrary grow size */; + 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**)yyrealloc + 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 yyensure_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*)); @@ -3553,9 +3319,9 @@ static void yyensure_buffer_stack (yyscan_t yyscanner) * @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. + * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +YY_BUFFER_STATE hsql__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) { YY_BUFFER_STATE b; @@ -3563,49 +3329,49 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscann 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 NULL; + return 0; - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + b = (YY_BUFFER_STATE) hsql_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in hsql__scan_buffer()" ); - b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ + 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 = NULL; + 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; - yy_switch_to_buffer( b , yyscanner ); + hsql__switch_to_buffer(b ,yyscanner ); return b; } -/** Setup the input buffer state to scan a string. The next call to yylex() will +/** 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 - * yy_scan_bytes() instead. + * hsql__scan_bytes() instead. */ -YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) +YY_BUFFER_STATE hsql__scan_string (yyconst char * yystr , yyscan_t yyscanner) { - return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); + return hsql__scan_bytes(yystr,strlen(yystr) ,yyscanner); } -/** Setup the input buffer state to scan the given bytes. The next call to yylex() will +/** 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 yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) +YY_BUFFER_STATE hsql__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner) { YY_BUFFER_STATE b; char *buf; @@ -3613,19 +3379,19 @@ YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan int i; /* Get memory for full buffer, including space for trailing EOB's. */ - n = (yy_size_t) (_yybytes_len + 2); - buf = (char *) yyalloc( n , yyscanner ); + n = _yybytes_len + 2; + buf = (char *) hsql_alloc(n ,yyscanner ); if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + 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 = yy_scan_buffer( buf, n , yyscanner); + b = hsql__scan_buffer(buf,n ,yyscanner); if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + 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. @@ -3639,11 +3405,9 @@ YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan #define YY_EXIT_FAILURE 2 #endif -static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) +static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - (void)yyg; - fprintf( stderr, "%s\n", msg ); + (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -3669,7 +3433,7 @@ static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) /** Get the user-defined data for this scanner. * @param yyscanner The scanner object. */ -YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) +YY_EXTRA_TYPE hsql_get_extra (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyextra; @@ -3678,10 +3442,10 @@ YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) /** Get the current line number. * @param yyscanner The scanner object. */ -int yyget_lineno (yyscan_t yyscanner) +int hsql_get_lineno (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - + if (! YY_CURRENT_BUFFER) return 0; @@ -3691,10 +3455,10 @@ int yyget_lineno (yyscan_t yyscanner) /** Get the current column number. * @param yyscanner The scanner object. */ -int yyget_column (yyscan_t yyscanner) +int hsql_get_column (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - + if (! YY_CURRENT_BUFFER) return 0; @@ -3704,7 +3468,7 @@ int yyget_column (yyscan_t yyscanner) /** Get the input stream. * @param yyscanner The scanner object. */ -FILE *yyget_in (yyscan_t yyscanner) +FILE *hsql_get_in (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyin; @@ -3713,7 +3477,7 @@ FILE *yyget_in (yyscan_t yyscanner) /** Get the output stream. * @param yyscanner The scanner object. */ -FILE *yyget_out (yyscan_t yyscanner) +FILE *hsql_get_out (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyout; @@ -3722,7 +3486,7 @@ FILE *yyget_out (yyscan_t yyscanner) /** Get the length of the current token. * @param yyscanner The scanner object. */ -int yyget_leng (yyscan_t yyscanner) +int hsql_get_leng (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyleng; @@ -3732,7 +3496,7 @@ int yyget_leng (yyscan_t yyscanner) * @param yyscanner The scanner object. */ -char *yyget_text (yyscan_t yyscanner) +char *hsql_get_text (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yytext; @@ -3742,93 +3506,93 @@ char *yyget_text (yyscan_t yyscanner) * @param user_defined The data to be associated with this scanner. * @param yyscanner The scanner object. */ -void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +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 line number + * @param line_number * @param yyscanner The scanner object. */ -void yyset_lineno (int _line_number , yyscan_t yyscanner) +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( "yyset_lineno called with no buffer" ); + yy_fatal_error( "hsql_set_lineno called with no buffer" , yyscanner); - yylineno = _line_number; + yylineno = line_number; } /** Set the current column. - * @param _column_no column number + * @param line_number * @param yyscanner The scanner object. */ -void yyset_column (int _column_no , yyscan_t yyscanner) +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( "yyset_column called with no buffer" ); + yy_fatal_error( "hsql_set_column called with no buffer" , yyscanner); - yycolumn = _column_no; + yycolumn = column_no; } /** Set the input stream. This does not discard the current * input buffer. - * @param _in_str A readable stream. + * @param in_str A readable stream. * @param yyscanner The scanner object. - * @see yy_switch_to_buffer + * @see hsql__switch_to_buffer */ -void yyset_in (FILE * _in_str , yyscan_t yyscanner) +void hsql_set_in (FILE * in_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyin = _in_str ; + yyin = in_str ; } -void yyset_out (FILE * _out_str , yyscan_t yyscanner) +void hsql_set_out (FILE * out_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyout = _out_str ; + yyout = out_str ; } -int yyget_debug (yyscan_t yyscanner) +int hsql_get_debug (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yy_flex_debug; } -void yyset_debug (int _bdebug , yyscan_t yyscanner) +void hsql_set_debug (int bdebug , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yy_flex_debug = _bdebug ; + yy_flex_debug = bdebug ; } /* Accessor methods for yylval and yylloc */ -YYSTYPE * yyget_lval (yyscan_t yyscanner) +YYSTYPE * hsql_get_lval (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yylval; } -void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) +void hsql_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylval = yylval_param; } -YYLTYPE *yyget_lloc (yyscan_t yyscanner) +YYLTYPE *hsql_get_lloc (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yylloc; } -void yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) +void hsql_set_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylloc = yylloc_param; @@ -3836,18 +3600,20 @@ void yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) /* User-visible API */ -/* yylex_init is special because it creates the scanner itself, so it is +/* 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 yylex_init(yyscan_t* ptr_yy_globals) + +int hsql_lex_init(yyscan_t* ptr_yy_globals) + { if (ptr_yy_globals == NULL){ errno = EINVAL; return 1; } - *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); + *ptr_yy_globals = (yyscan_t) hsql_alloc ( sizeof( struct yyguts_t ), NULL ); if (*ptr_yy_globals == NULL){ errno = ENOMEM; @@ -3860,37 +3626,39 @@ int yylex_init(yyscan_t* ptr_yy_globals) return yy_init_globals ( *ptr_yy_globals ); } -/* yylex_init_extra has the same functionality as yylex_init, but follows the +/* 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 yyalloc in + * The user defined value in the first argument will be available to hsql_alloc in * the yyextra field. */ -int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) + +int hsql_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) + { struct yyguts_t dummy_yyguts; - yyset_extra (yy_user_defined, &dummy_yyguts); + hsql_set_extra (yy_user_defined, &dummy_yyguts); if (ptr_yy_globals == NULL){ errno = EINVAL; return 1; } - - *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); - + + *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)); - - yyset_extra (yy_user_defined, *ptr_yy_globals); - + + hsql_set_extra (yy_user_defined, *ptr_yy_globals); + return yy_init_globals ( *ptr_yy_globals ); } @@ -3898,13 +3666,13 @@ 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 yylex_destroy(), so don't allocate here. + * This function is called from hsql_lex_destroy(), so don't allocate here. */ - yyg->yy_buffer_stack = NULL; + yyg->yy_buffer_stack = 0; yyg->yy_buffer_stack_top = 0; yyg->yy_buffer_stack_max = 0; - yyg->yy_c_buf_p = NULL; + yyg->yy_c_buf_p = (char *) 0; yyg->yy_init = 0; yyg->yy_start = 0; @@ -3917,42 +3685,42 @@ static int yy_init_globals (yyscan_t yyscanner) yyin = stdin; yyout = stdout; #else - yyin = NULL; - yyout = NULL; + yyin = (FILE *) 0; + yyout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by - * yylex_init() + * hsql_lex_init() */ return 0; } -/* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int yylex_destroy (yyscan_t yyscanner) +/* 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){ - yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); + hsql__delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); YY_CURRENT_BUFFER_LVALUE = NULL; - yypop_buffer_state(yyscanner); + hsql_pop_buffer_state(yyscanner); } /* Destroy the stack itself. */ - yyfree(yyg->yy_buffer_stack , yyscanner); + hsql_free(yyg->yy_buffer_stack ,yyscanner); yyg->yy_buffer_stack = NULL; /* Destroy the start condition stack. */ - yyfree( yyg->yy_start_stack , yyscanner ); + 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 - * yylex() is called, initialization will occur. */ + * hsql_lex() is called, initialization will occur. */ yy_init_globals( yyscanner); /* Destroy the main struct (reentrant only). */ - yyfree ( yyscanner , yyscanner ); + hsql_free ( yyscanner , yyscanner ); yyscanner = NULL; return 0; } @@ -3962,21 +3730,18 @@ int yylex_destroy (yyscan_t yyscanner) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - (void)yyg; - - int i; + register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (const char * s , yyscan_t yyscanner) +static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) { - int n; + register int n; for ( n = 0; s[n]; ++n ) ; @@ -3984,18 +3749,13 @@ static int yy_flex_strlen (const char * s , yyscan_t yyscanner) } #endif -void *yyalloc (yy_size_t size , yyscan_t yyscanner) +void *hsql_alloc (yy_size_t size , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - (void)yyg; - return malloc(size); + return (void *) malloc( size ); } -void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) +void *hsql_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - (void)yyg; - /* 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 @@ -4003,20 +3763,19 @@ void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return realloc(ptr, size); + return (void *) realloc( (char *) ptr, size ); } -void yyfree (void * ptr , yyscan_t yyscanner) +void hsql_free (void * ptr , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - (void)yyg; - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ + free( (char *) ptr ); /* see hsql_realloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 217 "flex_lexer.l" + /*************************** ** Section 3: User code ***************************/ diff --git a/src/parser/flex_lexer.h b/src/parser/flex_lexer.h index f500b82..d729bfc 100644 --- a/src/parser/flex_lexer.h +++ b/src/parser/flex_lexer.h @@ -2,9 +2,9 @@ #define hsql_HEADER_H 1 #define hsql_IN_HEADER 1 -#line 5 "flex_lexer.h" +#line 6 "flex_lexer.h" -#line 7 "flex_lexer.h" +#line 8 "flex_lexer.h" #define YY_INT_ALIGNED short int @@ -12,246 +12,12 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 4 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif -#ifdef yy_create_buffer -#define hsql__create_buffer_ALREADY_DEFINED -#else -#define yy_create_buffer hsql__create_buffer -#endif - -#ifdef yy_delete_buffer -#define hsql__delete_buffer_ALREADY_DEFINED -#else -#define yy_delete_buffer hsql__delete_buffer -#endif - -#ifdef yy_scan_buffer -#define hsql__scan_buffer_ALREADY_DEFINED -#else -#define yy_scan_buffer hsql__scan_buffer -#endif - -#ifdef yy_scan_string -#define hsql__scan_string_ALREADY_DEFINED -#else -#define yy_scan_string hsql__scan_string -#endif - -#ifdef yy_scan_bytes -#define hsql__scan_bytes_ALREADY_DEFINED -#else -#define yy_scan_bytes hsql__scan_bytes -#endif - -#ifdef yy_init_buffer -#define hsql__init_buffer_ALREADY_DEFINED -#else -#define yy_init_buffer hsql__init_buffer -#endif - -#ifdef yy_flush_buffer -#define hsql__flush_buffer_ALREADY_DEFINED -#else -#define yy_flush_buffer hsql__flush_buffer -#endif - -#ifdef yy_load_buffer_state -#define hsql__load_buffer_state_ALREADY_DEFINED -#else -#define yy_load_buffer_state hsql__load_buffer_state -#endif - -#ifdef yy_switch_to_buffer -#define hsql__switch_to_buffer_ALREADY_DEFINED -#else -#define yy_switch_to_buffer hsql__switch_to_buffer -#endif - -#ifdef yypush_buffer_state -#define hsql_push_buffer_state_ALREADY_DEFINED -#else -#define yypush_buffer_state hsql_push_buffer_state -#endif - -#ifdef yypop_buffer_state -#define hsql_pop_buffer_state_ALREADY_DEFINED -#else -#define yypop_buffer_state hsql_pop_buffer_state -#endif - -#ifdef yyensure_buffer_stack -#define hsql_ensure_buffer_stack_ALREADY_DEFINED -#else -#define yyensure_buffer_stack hsql_ensure_buffer_stack -#endif - -#ifdef yylex -#define hsql_lex_ALREADY_DEFINED -#else -#define yylex hsql_lex -#endif - -#ifdef yyrestart -#define hsql_restart_ALREADY_DEFINED -#else -#define yyrestart hsql_restart -#endif - -#ifdef yylex_init -#define hsql_lex_init_ALREADY_DEFINED -#else -#define yylex_init hsql_lex_init -#endif - -#ifdef yylex_init_extra -#define hsql_lex_init_extra_ALREADY_DEFINED -#else -#define yylex_init_extra hsql_lex_init_extra -#endif - -#ifdef yylex_destroy -#define hsql_lex_destroy_ALREADY_DEFINED -#else -#define yylex_destroy hsql_lex_destroy -#endif - -#ifdef yyget_debug -#define hsql_get_debug_ALREADY_DEFINED -#else -#define yyget_debug hsql_get_debug -#endif - -#ifdef yyset_debug -#define hsql_set_debug_ALREADY_DEFINED -#else -#define yyset_debug hsql_set_debug -#endif - -#ifdef yyget_extra -#define hsql_get_extra_ALREADY_DEFINED -#else -#define yyget_extra hsql_get_extra -#endif - -#ifdef yyset_extra -#define hsql_set_extra_ALREADY_DEFINED -#else -#define yyset_extra hsql_set_extra -#endif - -#ifdef yyget_in -#define hsql_get_in_ALREADY_DEFINED -#else -#define yyget_in hsql_get_in -#endif - -#ifdef yyset_in -#define hsql_set_in_ALREADY_DEFINED -#else -#define yyset_in hsql_set_in -#endif - -#ifdef yyget_out -#define hsql_get_out_ALREADY_DEFINED -#else -#define yyget_out hsql_get_out -#endif - -#ifdef yyset_out -#define hsql_set_out_ALREADY_DEFINED -#else -#define yyset_out hsql_set_out -#endif - -#ifdef yyget_leng -#define hsql_get_leng_ALREADY_DEFINED -#else -#define yyget_leng hsql_get_leng -#endif - -#ifdef yyget_text -#define hsql_get_text_ALREADY_DEFINED -#else -#define yyget_text hsql_get_text -#endif - -#ifdef yyget_lineno -#define hsql_get_lineno_ALREADY_DEFINED -#else -#define yyget_lineno hsql_get_lineno -#endif - -#ifdef yyset_lineno -#define hsql_set_lineno_ALREADY_DEFINED -#else -#define yyset_lineno hsql_set_lineno -#endif - -#ifdef yyget_column -#define hsql_get_column_ALREADY_DEFINED -#else -#define yyget_column hsql_get_column -#endif - -#ifdef yyset_column -#define hsql_set_column_ALREADY_DEFINED -#else -#define yyset_column hsql_set_column -#endif - -#ifdef yywrap -#define hsql_wrap_ALREADY_DEFINED -#else -#define yywrap hsql_wrap -#endif - -#ifdef yyget_lval -#define hsql_get_lval_ALREADY_DEFINED -#else -#define yyget_lval hsql_get_lval -#endif - -#ifdef yyset_lval -#define hsql_set_lval_ALREADY_DEFINED -#else -#define yyset_lval hsql_set_lval -#endif - -#ifdef yyget_lloc -#define hsql_get_lloc_ALREADY_DEFINED -#else -#define yyget_lloc hsql_get_lloc -#endif - -#ifdef yyset_lloc -#define hsql_set_lloc_ALREADY_DEFINED -#else -#define yyset_lloc hsql_set_lloc -#endif - -#ifdef yyalloc -#define hsql_alloc_ALREADY_DEFINED -#else -#define yyalloc hsql_alloc -#endif - -#ifdef yyrealloc -#define hsql_realloc_ALREADY_DEFINED -#else -#define yyrealloc hsql_realloc -#endif - -#ifdef yyfree -#define hsql_free_ALREADY_DEFINED -#else -#define yyfree hsql_free -#endif - /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ @@ -322,23 +88,29 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#ifndef SIZE_MAX -#define SIZE_MAX (~(size_t)0) -#endif - #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -/* begin standard C++ headers. */ +#ifdef __cplusplus -/* TODO: this is always defined, so inline it */ +/* 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 - -#if defined(__GNUC__) && __GNUC__ >= 3 -#define yynoreturn __attribute__((__noreturn__)) #else -#define yynoreturn +#define yyconst #endif /* An opaque pointer. */ @@ -393,7 +165,7 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - int yy_buf_size; + yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. @@ -421,7 +193,7 @@ struct yy_buffer_state 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. */ @@ -432,25 +204,25 @@ struct yy_buffer_state }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ -void yyrestart ( FILE *input_file , yyscan_t yyscanner ); -void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); -YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); -void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); -void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); -void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); -void yypop_buffer_state ( yyscan_t yyscanner ); +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 yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , 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 *yyalloc ( yy_size_t , yyscan_t yyscanner ); -void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); -void yyfree ( void * , 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(yyscanner) (/*CONSTCOND*/1) +#define hsql_wrap(n) 1 #define YY_SKIP_YYWRAP #define yytext_ptr yytext_r @@ -473,50 +245,46 @@ void yyfree ( void * , yyscan_t yyscanner ); #define YY_EXTRA_TYPE void * #endif -int yylex_init (yyscan_t* scanner); +int hsql_lex_init (yyscan_t* scanner); -int yylex_init_extra ( YY_EXTRA_TYPE user_defined, 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 yylex_destroy ( yyscan_t yyscanner ); +int hsql_lex_destroy (yyscan_t yyscanner ); -int yyget_debug ( yyscan_t yyscanner ); +int hsql_get_debug (yyscan_t yyscanner ); -void yyset_debug ( int debug_flag , yyscan_t yyscanner ); +void hsql_set_debug (int debug_flag ,yyscan_t yyscanner ); -YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); +YY_EXTRA_TYPE hsql_get_extra (yyscan_t yyscanner ); -void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); +void hsql_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); -FILE *yyget_in ( yyscan_t yyscanner ); +FILE *hsql_get_in (yyscan_t yyscanner ); -void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); +void hsql_set_in (FILE * in_str ,yyscan_t yyscanner ); -FILE *yyget_out ( yyscan_t yyscanner ); +FILE *hsql_get_out (yyscan_t yyscanner ); -void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); +void hsql_set_out (FILE * out_str ,yyscan_t yyscanner ); - int yyget_leng ( yyscan_t yyscanner ); +int hsql_get_leng (yyscan_t yyscanner ); -char *yyget_text ( yyscan_t yyscanner ); +char *hsql_get_text (yyscan_t yyscanner ); -int yyget_lineno ( yyscan_t yyscanner ); +int hsql_get_lineno (yyscan_t yyscanner ); -void yyset_lineno ( int _line_number , yyscan_t yyscanner ); +void hsql_set_lineno (int line_number ,yyscan_t yyscanner ); -int yyget_column ( yyscan_t yyscanner ); +YYSTYPE * hsql_get_lval (yyscan_t yyscanner ); -void yyset_column ( int _column_no , yyscan_t yyscanner ); +void hsql_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); -YYSTYPE * yyget_lval ( yyscan_t yyscanner ); - -void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner ); - - YYLTYPE *yyget_lloc ( yyscan_t yyscanner ); + YYLTYPE *hsql_get_lloc (yyscan_t yyscanner ); - void yyset_lloc ( YYLTYPE * yylloc_param , 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. @@ -524,18 +292,18 @@ void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap ( yyscan_t yyscanner ); +extern "C" int hsql_wrap (yyscan_t yyscanner ); #else -extern int yywrap ( yyscan_t yyscanner ); +extern int hsql_wrap (yyscan_t yyscanner ); #endif #endif #ifndef yytext_ptr -static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT @@ -563,10 +331,10 @@ static int yy_flex_strlen ( const char * , yyscan_t yyscanner); #ifndef YY_DECL #define YY_DECL_IS_OURS 1 -extern int yylex \ - (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner); +extern int hsql_lex \ + (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner); -#define YY_DECL int yylex \ +#define YY_DECL int hsql_lex \ (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) #endif /* !YY_DECL */ @@ -584,154 +352,9 @@ extern int yylex \ #undef YY_DECL #endif -#ifndef hsql__create_buffer_ALREADY_DEFINED -#undef yy_create_buffer -#endif -#ifndef hsql__delete_buffer_ALREADY_DEFINED -#undef yy_delete_buffer -#endif -#ifndef hsql__scan_buffer_ALREADY_DEFINED -#undef yy_scan_buffer -#endif -#ifndef hsql__scan_string_ALREADY_DEFINED -#undef yy_scan_string -#endif -#ifndef hsql__scan_bytes_ALREADY_DEFINED -#undef yy_scan_bytes -#endif -#ifndef hsql__init_buffer_ALREADY_DEFINED -#undef yy_init_buffer -#endif -#ifndef hsql__flush_buffer_ALREADY_DEFINED -#undef yy_flush_buffer -#endif -#ifndef hsql__load_buffer_state_ALREADY_DEFINED -#undef yy_load_buffer_state -#endif -#ifndef hsql__switch_to_buffer_ALREADY_DEFINED -#undef yy_switch_to_buffer -#endif -#ifndef hsql_push_buffer_state_ALREADY_DEFINED -#undef yypush_buffer_state -#endif -#ifndef hsql_pop_buffer_state_ALREADY_DEFINED -#undef yypop_buffer_state -#endif -#ifndef hsql_ensure_buffer_stack_ALREADY_DEFINED -#undef yyensure_buffer_stack -#endif -#ifndef hsql_lex_ALREADY_DEFINED -#undef yylex -#endif -#ifndef hsql_restart_ALREADY_DEFINED -#undef yyrestart -#endif -#ifndef hsql_lex_init_ALREADY_DEFINED -#undef yylex_init -#endif -#ifndef hsql_lex_init_extra_ALREADY_DEFINED -#undef yylex_init_extra -#endif -#ifndef hsql_lex_destroy_ALREADY_DEFINED -#undef yylex_destroy -#endif -#ifndef hsql_get_debug_ALREADY_DEFINED -#undef yyget_debug -#endif -#ifndef hsql_set_debug_ALREADY_DEFINED -#undef yyset_debug -#endif -#ifndef hsql_get_extra_ALREADY_DEFINED -#undef yyget_extra -#endif -#ifndef hsql_set_extra_ALREADY_DEFINED -#undef yyset_extra -#endif -#ifndef hsql_get_in_ALREADY_DEFINED -#undef yyget_in -#endif -#ifndef hsql_set_in_ALREADY_DEFINED -#undef yyset_in -#endif -#ifndef hsql_get_out_ALREADY_DEFINED -#undef yyget_out -#endif -#ifndef hsql_set_out_ALREADY_DEFINED -#undef yyset_out -#endif -#ifndef hsql_get_leng_ALREADY_DEFINED -#undef yyget_leng -#endif -#ifndef hsql_get_text_ALREADY_DEFINED -#undef yyget_text -#endif -#ifndef hsql_get_lineno_ALREADY_DEFINED -#undef yyget_lineno -#endif -#ifndef hsql_set_lineno_ALREADY_DEFINED -#undef yyset_lineno -#endif -#ifndef hsql_get_column_ALREADY_DEFINED -#undef yyget_column -#endif -#ifndef hsql_set_column_ALREADY_DEFINED -#undef yyset_column -#endif -#ifndef hsql_wrap_ALREADY_DEFINED -#undef yywrap -#endif -#ifndef hsql_get_lval_ALREADY_DEFINED -#undef yyget_lval -#endif -#ifndef hsql_set_lval_ALREADY_DEFINED -#undef yyset_lval -#endif -#ifndef hsql_get_lloc_ALREADY_DEFINED -#undef yyget_lloc -#endif -#ifndef hsql_set_lloc_ALREADY_DEFINED -#undef yyset_lloc -#endif -#ifndef hsql_alloc_ALREADY_DEFINED -#undef yyalloc -#endif -#ifndef hsql_realloc_ALREADY_DEFINED -#undef yyrealloc -#endif -#ifndef hsql_free_ALREADY_DEFINED -#undef yyfree -#endif -#ifndef hsql_text_ALREADY_DEFINED -#undef yytext -#endif -#ifndef hsql_leng_ALREADY_DEFINED -#undef yyleng -#endif -#ifndef hsql_in_ALREADY_DEFINED -#undef yyin -#endif -#ifndef hsql_out_ALREADY_DEFINED -#undef yyout -#endif -#ifndef hsql__flex_debug_ALREADY_DEFINED -#undef yy_flex_debug -#endif -#ifndef hsql_lineno_ALREADY_DEFINED -#undef yylineno -#endif -#ifndef hsql_tables_fload_ALREADY_DEFINED -#undef yytables_fload -#endif -#ifndef hsql_tables_destroy_ALREADY_DEFINED -#undef yytables_destroy -#endif -#ifndef hsql_TABLES_NAME_ALREADY_DEFINED -#undef yyTABLES_NAME -#endif - #line 217 "flex_lexer.l" -#line 735 "flex_lexer.h" +#line 359 "flex_lexer.h" #undef hsql_IN_HEADER #endif /* hsql_HEADER_H */ diff --git a/src/sql/SQLStatement.h b/src/sql/SQLStatement.h index 07996fc..db7cbf1 100644 --- a/src/sql/SQLStatement.h +++ b/src/sql/SQLStatement.h @@ -19,7 +19,8 @@ namespace hsql { kStmtExecute, kStmtExport, kStmtRename, - kStmtAlter + kStmtAlter, + kStmtShow }; // Base struct for every SQL statement diff --git a/src/sql/ShowStatement.h b/src/sql/ShowStatement.h new file mode 100644 index 0000000..206a819 --- /dev/null +++ b/src/sql/ShowStatement.h @@ -0,0 +1,26 @@ +#ifndef __SQLPARSER__SHOW_STATEMENT_H__ +#define __SQLPARSER__SHOW_STATEMENT_H__ + +#include "SQLStatement.h" + +// Note: Implementations of constructors and destructors can be found in statements.cpp. +namespace hsql { + + enum ShowType { + kShowColumns, + kShowTables + }; + + // Represents SQL SHOW statements. + // Example "SHOW TABLES;" + struct ShowStatement : SQLStatement { + + ShowStatement(ShowType type); + virtual ~ShowStatement(); + + ShowType type; + char* name; + }; + +} // namespace hsql +#endif diff --git a/src/sql/statements.cpp b/src/sql/statements.cpp index ab4320a..af83ae2 100644 --- a/src/sql/statements.cpp +++ b/src/sql/statements.cpp @@ -121,6 +121,16 @@ namespace hsql { } } + // ShowStatament + ShowStatement::ShowStatement(ShowType type) : + SQLStatement(kStmtShow), + type(type), + name(nullptr) {} + + ShowStatement::~ShowStatement() { + free(name); + } + // SelectStatement.h // OrderDescription diff --git a/src/sql/statements.h b/src/sql/statements.h index d9e59ea..0838256 100644 --- a/src/sql/statements.h +++ b/src/sql/statements.h @@ -10,5 +10,6 @@ #include "DropStatement.h" #include "PrepareStatement.h" #include "ExecuteStatement.h" +#include "ShowStatement.h" -#endif // __SQLPARSER__STATEMENTS_H__ \ No newline at end of file +#endif // __SQLPARSER__STATEMENTS_H__ diff --git a/test/queries/queries-bad.sql b/test/queries/queries-bad.sql index f67c7c8..5437c4f 100644 --- a/test/queries/queries-bad.sql +++ b/test/queries/queries-bad.sql @@ -8,4 +8,5 @@ !CREATE TABLE "table" FROM TBL FILE 'students.tbl';SELECT 1 !CREATE TABLE "table" FROM TBL FILE 'students.tbl';1 !INSERT INTO test_table VALUESd (1, 2, 'test'); -!SELECT * FROM t WHERE a = ? AND b = ?;SELECT 1; \ No newline at end of file +!SELECT * FROM t WHERE a = ? AND b = ?;SELECT 1; +!SHOW COLUMNS; diff --git a/test/queries/queries-good.sql b/test/queries/queries-good.sql index 294aa63..ec0d431 100644 --- a/test/queries/queries-good.sql +++ b/test/queries/queries-good.sql @@ -48,4 +48,6 @@ DEALLOCATE PREPARE prep; # HINTS SELECT * FROM test WITH HINT(NO_CACHE); SELECT * FROM test WITH HINT(NO_CACHE, NO_SAMPLING); -SELECT * FROM test WITH HINT(NO_CACHE, SAMPLE_RATE(0.1), OMW(1.0, 'test')); \ No newline at end of file +SELECT * FROM test WITH HINT(NO_CACHE, SAMPLE_RATE(0.1), OMW(1.0, 'test')); +SHOW TABLES; +SHOW COLUMNS students; diff --git a/test/sql_tests.cpp b/test/sql_tests.cpp index 5e63973..9c9cc82 100644 --- a/test/sql_tests.cpp +++ b/test/sql_tests.cpp @@ -127,6 +127,31 @@ TEST(ReleaseStatementTest) { } } +TEST(ShowTableStatementTest) { + TEST_PARSE_SINGLE_SQL( + "SHOW TABLES;", + kStmtShow, + ShowStatement, + result, + stmt); + + ASSERT_EQ(stmt->type, kShowTables); + ASSERT_NULL(stmt->name); +} + +TEST(ShowColumnsStatementTest) { + TEST_PARSE_SINGLE_SQL( + "SHOW COLUMNS students;", + kStmtShow, + ShowStatement, + result, + stmt); + + ASSERT_EQ(stmt->type, kShowColumns); + ASSERT_NOTNULL(stmt->name); + ASSERT_STREQ(stmt->name, "students"); +} + SQLParserResult parse_and_move(std::string query) { hsql::SQLParserResult result;