Column-oriented GPU-accelerated Database Management System
CoGaDB
|
00001 /* A Bison parser, made by GNU Bison 2.5. */ 00002 00003 /* Skeleton interface for Bison LALR(1) parsers in C++ 00004 00005 Copyright (C) 2002-2011 Free Software Foundation, Inc. 00006 00007 This program is free software: you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation, either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 00019 00020 /* As a special exception, you may create a larger work that contains 00021 part or all of the Bison parser skeleton and distribute that work 00022 under terms of your choice, so long as that work isn't itself a 00023 parser generator using the skeleton or a modified version thereof 00024 as a parser skeleton. Alternatively, if you modify or redistribute 00025 the parser skeleton itself, you may (at your option) remove this 00026 special exception, which will cause the skeleton and the resulting 00027 Bison output files to be licensed under the GNU General Public 00028 License without this special exception. 00029 00030 This special exception was added by the Free Software Foundation in 00031 version 2.2 of Bison. */ 00032 00033 /* C++ LALR(1) parser skeleton written by Akim Demaille. */ 00034 00035 #ifndef PARSER_HEADER_H 00036 # define PARSER_HEADER_H 00037 00038 /* "%code requires" blocks. */ 00039 00040 /* Line 35 of lalr1.cc */ 00041 #line 24 "src/sql/server/sql_parser.ypp" 00042 00043 namespace CoGaDB { 00044 namespace SQL { 00045 namespace Scanner { 00046 typedef void *type; 00047 } 00048 class Driver; 00049 } 00050 } /* namespace CoGaDB */ 00051 00052 00053 /* Line 35 of lalr1.cc */ 00054 #line 45 "src/sql/server/sql_parser.ypp" 00055 00056 #ifndef NDEBUG 00057 #define YYDEBUG 1 00058 #endif 00059 00060 00061 /* Line 35 of lalr1.cc */ 00062 #line 71 "src/sql/server/sql_parser.ypp" 00063 00074 #include <utility> 00075 00076 #include "sql/server/sql_parsetree.hpp" 00077 00078 00079 00080 /* Line 35 of lalr1.cc */ 00081 #line 82 "/home/sebastian/gpudbms/trunk/cogadb/src/sql/server/sql_parser.hpp" 00082 00083 00084 #include <string> 00085 #include <iostream> 00086 #include "stack.hh" 00087 #include "location.hh" 00088 00089 /* Enabling traces. */ 00090 #ifndef YYDEBUG 00091 # define YYDEBUG 0 00092 #endif 00093 00094 /* Enabling verbose error messages. */ 00095 #ifdef YYERROR_VERBOSE 00096 # undef YYERROR_VERBOSE 00097 # define YYERROR_VERBOSE 1 00098 #else 00099 # define YYERROR_VERBOSE 0 00100 #endif 00101 00102 /* Enabling the token table. */ 00103 #ifndef YYTOKEN_TABLE 00104 # define YYTOKEN_TABLE 0 00105 #endif 00106 00107 00108 /* Line 35 of lalr1.cc */ 00109 #line 14 "src/sql/server/sql_parser.ypp" 00110 namespace CoGaDB { namespace SQL { 00111 00112 /* Line 35 of lalr1.cc */ 00113 #line 114 "/home/sebastian/gpudbms/trunk/cogadb/src/sql/server/sql_parser.hpp" 00114 00116 class Parser 00117 { 00118 public: 00120 #ifndef YYSTYPE 00121 union semantic_type 00122 { 00123 00124 /* Line 35 of lalr1.cc */ 00125 #line 93 "src/sql/server/sql_parser.ypp" 00126 00127 ParseTree::String *string; 00128 ParseTree::Integer *integer; 00129 00130 ParseTree::AggregationFunction aggregation_function; 00131 00132 00133 /* Line 35 of lalr1.cc */ 00134 #line 107 "src/sql/server/sql_parser.ypp" 00135 00136 ParseTree::ValueComparator comparator; 00137 00138 00139 /* Line 35 of lalr1.cc */ 00140 #line 137 "src/sql/server/sql_parser.ypp" 00141 00142 /* 00143 ParseTree::Sequence *sequence; 00144 */ 00145 ParseTree::Statement *statement; 00146 00147 00148 /* Line 35 of lalr1.cc */ 00149 #line 148 "src/sql/server/sql_parser.ypp" 00150 00151 ParseTree::AttributeType attribute_type; 00152 ParseTree::TableName *table_name; 00153 ParseTree::Attribute *attribute; 00154 ParseTree::TableSchema *schema; 00155 ParseTree::Table *table; 00156 ParseTree::CreateTable *create_table; 00157 00158 00159 /* Line 35 of lalr1.cc */ 00160 #line 163 "src/sql/server/sql_parser.ypp" 00161 00162 ParseTree::ColumnList *column_list; 00163 ParseTree::AtomExpression *atom_expression; 00164 ParseTree::Tuple *tuple; 00165 ParseTree::InsertInto *insert_into; 00166 00167 00168 /* Line 35 of lalr1.cc */ 00169 #line 174 "src/sql/server/sql_parser.ypp" 00170 00171 ParseTree::Predicate *predicate; 00172 ParseTree::SearchCondition *search_condition; 00173 ParseTree::InnerJoin *inner_join; 00174 ParseTree::CrossJoin *cross_join; 00175 ParseTree::Join *join; 00176 ParseTree::TableReference *table_reference; 00177 ParseTree::TableReferenceList *table_reference_list; 00178 ParseTree::TableExpression *table_expression; 00179 ParseTree::SortOrder sort_order; 00180 ParseTree::OrderingSpec *ordering_spec; 00181 ParseTree::OrderBy *order_by; 00182 ParseTree::FunctionExpression *function_expression; 00183 ParseTree::ScalarExpression *scalar_expression; 00184 ParseTree::ScalarExpressionList *scalar_expression_list; 00185 ParseTree::SelectFrom *select_from; 00186 00187 00188 00189 /* Line 35 of lalr1.cc */ 00190 #line 191 "/home/sebastian/gpudbms/trunk/cogadb/src/sql/server/sql_parser.hpp" 00191 }; 00192 #else 00193 typedef YYSTYPE semantic_type; 00194 #endif 00195 00196 typedef location location_type; 00198 struct token 00199 { 00200 /* Tokens. */ 00201 enum yytokentype { 00202 END = 0, 00203 NAME = 258, 00204 STRING = 259, 00205 INTNUM = 260, 00206 APPROXNUM = 261, 00207 AMMSC = 262, 00208 OR = 263, 00209 AND = 264, 00210 NOT = 265, 00211 COMPARISON = 266, 00212 UMINUS = 267, 00213 ALL = 268, 00214 ANY = 269, 00215 AS = 270, 00216 ASC = 271, 00217 AUTHORIZATION = 272, 00218 BETWEEN = 273, 00219 BY = 274, 00220 CHARACTER = 275, 00221 CHECK = 276, 00222 CLOSE = 277, 00223 COMMIT = 278, 00224 CONTINUE = 279, 00225 CREATE = 280, 00226 CROSS = 281, 00227 CURRENT = 282, 00228 CURSOR = 283, 00229 DECIMAL = 284, 00230 DECLARE = 285, 00231 DEFAULT = 286, 00232 DELETE = 287, 00233 DESC = 288, 00234 DISTINCT = 289, 00235 DOUBLE = 290, 00236 ESCAPE = 291, 00237 EXISTS = 292, 00238 FETCH = 293, 00239 FLOAT = 294, 00240 FOR = 295, 00241 FOREIGN = 296, 00242 FOUND = 297, 00243 FROM = 298, 00244 GOTO = 299, 00245 GRANT = 300, 00246 GROUP = 301, 00247 HAVING = 302, 00248 IN = 303, 00249 INDICATOR = 304, 00250 INNER = 305, 00251 INSERT = 306, 00252 INTEGER = 307, 00253 INTO = 308, 00254 IS = 309, 00255 JOIN = 310, 00256 KEY = 311, 00257 LANGUAGE = 312, 00258 LIKE = 313, 00259 MODULE = 314, 00260 NULLX = 315, 00261 NUMERIC = 316, 00262 OF = 317, 00263 ON = 318, 00264 OPEN = 319, 00265 OPTION = 320, 00266 ORDER = 321, 00267 PRECISION = 322, 00268 PRIMARY = 323, 00269 PRIVILEGES = 324, 00270 PROCEDURE = 325, 00271 PUBLIC = 326, 00272 REAL = 327, 00273 REFERENCES = 328, 00274 ROLLBACK = 329, 00275 SCHEMA = 330, 00276 SELECT = 331, 00277 SET = 332, 00278 SMALLINT = 333, 00279 SOME = 334, 00280 SQLCODE = 335, 00281 SQLERROR = 336, 00282 TABLE = 337, 00283 TO = 338, 00284 UNION = 339, 00285 UNIQUE = 340, 00286 UPDATE = 341, 00287 USER = 342, 00288 VALUES = 343, 00289 VARCHAR = 344, 00290 VIEW = 345, 00291 WHENEVER = 346, 00292 WHERE = 347, 00293 WITH = 348, 00294 WORK = 349, 00295 COBOL = 350, 00296 FORTRAN = 351, 00297 PASCAL = 352, 00298 PLI = 353, 00299 C = 354, 00300 ADA = 355 00301 }; 00302 00303 }; 00305 typedef token::yytokentype token_type; 00306 00308 Parser (CoGaDB::SQL::Driver &driver_yyarg, CoGaDB::SQL::Scanner::type &scanner_yyarg); 00309 virtual ~Parser (); 00310 00313 virtual int parse (); 00314 00315 #if YYDEBUG 00316 00317 std::ostream& debug_stream () const; 00319 void set_debug_stream (std::ostream &); 00320 00322 typedef int debug_level_type; 00324 debug_level_type debug_level () const; 00326 void set_debug_level (debug_level_type l); 00327 #endif 00328 00329 private: 00333 virtual void error (const location_type& loc, const std::string& msg); 00334 00338 virtual std::string yysyntax_error_ (int yystate, int tok); 00339 00340 #if YYDEBUG 00341 00342 00343 00344 00345 virtual void yy_symbol_value_print_ (int yytype, 00346 const semantic_type* yyvaluep, 00347 const location_type* yylocationp); 00352 virtual void yy_symbol_print_ (int yytype, 00353 const semantic_type* yyvaluep, 00354 const location_type* yylocationp); 00355 #endif 00356 00357 00359 typedef int state_type; 00361 typedef stack<state_type> state_stack_type; 00363 typedef stack<semantic_type> semantic_stack_type; 00365 typedef stack<location_type> location_stack_type; 00366 00368 state_stack_type yystate_stack_; 00370 semantic_stack_type yysemantic_stack_; 00372 location_stack_type yylocation_stack_; 00373 00376 static bool yy_pact_value_is_default_ (int yyvalue); 00377 00380 static bool yy_table_value_is_error_ (int yyvalue); 00381 00383 typedef unsigned char token_number_type; 00384 /* Tables. */ 00386 static const short int yypact_[]; 00387 static const short int yypact_ninf_; 00388 00392 static const unsigned short int yydefact_[]; 00393 00394 static const short int yypgoto_[]; 00395 static const short int yydefgoto_[]; 00396 00402 static const short int yytable_[]; 00403 static const short int yytable_ninf_; 00404 00405 static const short int yycheck_[]; 00406 00408 static const unsigned char yystos_[]; 00409 00411 static const unsigned char yyr1_[]; 00413 static const unsigned char yyr2_[]; 00414 00415 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 00416 00417 static const char* const yytname_[]; 00418 #endif 00419 00420 #if YYDEBUG 00421 00422 typedef short int rhs_number_type; 00424 static const rhs_number_type yyrhs_[]; 00426 static const unsigned short int yyprhs_[]; 00428 static const unsigned short int yyrline_[]; 00430 static const unsigned short int yytoken_number_[]; 00432 virtual void yy_reduce_print_ (int r); 00434 virtual void yystack_print_ (); 00435 00436 /* Debugging. */ 00437 int yydebug_; 00438 std::ostream* yycdebug_; 00439 #endif 00440 00442 token_number_type yytranslate_ (int t); 00443 00449 inline void yydestruct_ (const char* yymsg, 00450 int yytype, 00451 semantic_type* yyvaluep, 00452 location_type* yylocationp); 00453 00455 inline void yypop_ (unsigned int n = 1); 00456 00457 /* Constants. */ 00458 static const int yyeof_; 00459 /* LAST_ -- Last index in TABLE_. */ 00460 static const int yylast_; 00461 static const int yynnts_; 00462 static const int yyempty_; 00463 static const int yyfinal_; 00464 static const int yyterror_; 00465 static const int yyerrcode_; 00466 static const int yyntokens_; 00467 static const unsigned int yyuser_token_number_max_; 00468 static const token_number_type yyundef_token_; 00469 00470 /* User arguments. */ 00471 CoGaDB::SQL::Driver &driver; 00472 CoGaDB::SQL::Scanner::type &scanner; 00473 }; 00474 00475 /* Line 35 of lalr1.cc */ 00476 #line 14 "src/sql/server/sql_parser.ypp" 00477 } } // CoGaDB::SQL 00478 00479 /* Line 35 of lalr1.cc */ 00480 #line 481 "/home/sebastian/gpudbms/trunk/cogadb/src/sql/server/sql_parser.hpp" 00481 00482 00483 00484 #endif /* ! defined PARSER_HEADER_H */