Column-oriented GPU-accelerated Database Management System
CoGaDB
|
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <iostream>
#include <string>
#include <boost/algorithm/string.hpp>
#include "sql_parser.hpp"
#include "sql/server/sql_driver.hpp"
#include "sql/server/sql_parsetree.hpp"
#include <unistd.h>
#define BEGIN yyg->yy_start = 1 + 2 * |
#define cogadb_sql_scanner_wrap | ( | n | ) | 1 |
Referenced by CoGaDB::SQL::commandlineExec(), and main().
#define EOB_ACT_CONTINUE_SCAN 0 |
#define EOB_ACT_END_OF_FILE 1 |
#define EOB_ACT_LAST_MATCH 2 |
#define FLEX_BETA |
#define FLEX_SCANNER |
#define FLEXINT_H |
#define INITIAL 0 |
#define INT16_MAX (32767) |
#define INT16_MIN (-32767-1) |
#define INT32_MAX (2147483647) |
#define INT32_MIN (-2147483647-1) |
#define INT8_MAX (127) |
#define INT8_MIN (-128) |
#define REJECT reject_used_but_not_detected |
#define TOK | ( | NAME | ) |
do { \ return Parser::token::NAME; \ } while (0)
#define UINT16_MAX (65535U) |
#define UINT32_MAX (4294967295U) |
#define UINT8_MAX (255U) |
#define unput | ( | c | ) | yyunput( c, yyg->yytext_ptr , yyscanner ) |
#define YY_AT_BOL | ( | ) | (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) |
#define YY_BREAK break; |
#define YY_BUF_SIZE 16384 |
Referenced by CoGaDB::SQL::Driver::set_input().
#define YY_BUFFER_EOF_PENDING 2 |
#define YY_BUFFER_NEW 0 |
Referenced by cogadb_sql_scanner__flush_buffer(), and cogadb_sql_scanner__scan_buffer().
#define YY_BUFFER_NORMAL 1 |
#define YY_CURRENT_BUFFER |
( yyg->yy_buffer_stack \ ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ : NULL)
Referenced by cogadb_sql_scanner__flush_buffer(), cogadb_sql_scanner__init_buffer(), cogadb_sql_scanner_get_column(), cogadb_sql_scanner_get_lineno(), cogadb_sql_scanner_lex_destroy(), cogadb_sql_scanner_pop_buffer_state(), cogadb_sql_scanner_push_buffer_state(), cogadb_sql_scanner_set_column(), and cogadb_sql_scanner_set_lineno().
#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] |
#define YY_DECL |
CoGaDB::SQL::Parser::token_type \ CoGaDB::SQL::Scanner::lex(YYSTYPE *yylval_param, yyscan_t yyscanner)
#define YY_DO_BEFORE_ACTION |
yyg->yytext_ptr = yy_bp; \
yyg->yytext_ptr -= yyg->yy_more_len; \
yyleng = (size_t) (yy_cp - yyg->yytext_ptr); \
yyg->yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp;
#define YY_END_OF_BUFFER 118 |
#define YY_END_OF_BUFFER_CHAR 0 |
#define YY_EXIT_FAILURE 2 |
Referenced by yy_fatal_error().
#define YY_EXTRA_TYPE CoGaDB::SQL::Driver * |
#define YY_FATAL_ERROR | ( | msg | ) | yy_fatal_error( msg , yyscanner) |
#define yy_flex_debug yyg->yy_flex_debug_r |
Referenced by cogadb_sql_scanner_get_debug(), and cogadb_sql_scanner_set_debug().
#define YY_FLEX_MAJOR_VERSION 2 |
#define YY_FLEX_MINOR_VERSION 5 |
#define YY_FLEX_SUBMINOR_VERSION 35 |
#define YY_FLUSH_BUFFER cogadb_sql_scanner__flush_buffer(YY_CURRENT_BUFFER ,yyscanner) |
#define YY_INPUT | ( | buf, | |
result, | |||
max_size | |||
) |
#define YY_INT_ALIGNED short int |
#define YY_LESS_LINENO | ( | n | ) |
#define YY_MORE_ADJ yyg->yy_more_len |
#define YY_NEW_FILE cogadb_sql_scanner_restart(yyin ,yyscanner ) |
#define YY_NULL 0 |
#define YY_NUM_RULES 117 |
#define YY_READ_BUF_SIZE 8192 |
#define YY_RESTORE_YY_MORE_OFFSET |
#define YY_RULE_SETUP YY_USER_ACTION |
#define YY_SC_TO_UI | ( | c | ) | ((unsigned int) (unsigned char) c) |
#define yy_set_bol | ( | at_bol | ) |
{ \ if ( ! YY_CURRENT_BUFFER ){\ cogadb_sql_scanner_ensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ cogadb_sql_scanner__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ }
#define yy_set_interactive | ( | is_interactive | ) |
{ \ if ( ! YY_CURRENT_BUFFER ){ \ cogadb_sql_scanner_ensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ cogadb_sql_scanner__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ }
#define YY_SKIP_YYWRAP |
#define YY_START ((yyg->yy_start - 1) / 2) |
#define YY_START_STACK_INCR 25 |
#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) |
#define YY_STATE_EOF | ( | state | ) | (YY_END_OF_BUFFER + state + 1) |
#define YY_STRUCT_YY_BUFFER_STATE |
#define YY_TYPEDEF_YY_BUFFER_STATE |
#define YY_TYPEDEF_YY_SCANNER_T |
#define YY_TYPEDEF_YY_SIZE_T |
#define YY_USER_ACTION |
#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) |
Referenced by cogadb_sql_scanner_get_column(), and cogadb_sql_scanner_set_column().
#define yyconst |
#define yyextra yyg->yyextra_r |
Referenced by cogadb_sql_scanner_get_extra(), and cogadb_sql_scanner_set_extra().
#define yyin yyg->yyin_r |
Referenced by cogadb_sql_scanner_get_in(), cogadb_sql_scanner_set_in(), and yy_init_globals().
#define yyleng yyg->yyleng_r |
Referenced by cogadb_sql_scanner_get_leng().
#define yyless | ( | n | ) |
do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = yyg->yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 )
#define yyless | ( | n | ) |
do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = yyg->yy_hold_char; \ yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ yyg->yy_hold_char = *yyg->yy_c_buf_p; \ *yyg->yy_c_buf_p = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 )
#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) |
Referenced by cogadb_sql_scanner_get_lineno(), and cogadb_sql_scanner_set_lineno().
#define yylval yyg->yylval_r |
Referenced by cogadb_sql_scanner_get_lval(), cogadb_sql_scanner_set_lval(), and CoGaDB::SQL::Parser::parse().
#define yymore | ( | ) | (yyg->yy_more_flag = 1) |
#define yyout yyg->yyout_r |
Referenced by cogadb_sql_scanner_get_out(), cogadb_sql_scanner_set_out(), and yy_init_globals().
#define YYTABLES_NAME "yytables" |
#define yyterminate | ( | ) | TOK(END) |
#define yytext yyg->yytext_r |
Referenced by cogadb_sql_scanner_get_text().
#define yytext_ptr yytext_r |
typedef short int flex_int16_t |
typedef int flex_int32_t |
typedef signed char flex_int8_t |
typedef unsigned short int flex_uint16_t |
typedef unsigned int flex_uint32_t |
typedef unsigned char flex_uint8_t |
typedef struct yy_buffer_state* YY_BUFFER_STATE |
typedef unsigned char YY_CHAR |
typedef size_t yy_size_t |
typedef int yy_state_type |
typedef void* yyscan_t |
typedef Parser::semantic_type YYSTYPE |
YY_BUFFER_STATE cogadb_sql_scanner__create_buffer | ( | FILE * | file, |
int | size, | ||
yyscan_t | yyscanner | ||
) |
void cogadb_sql_scanner__delete_buffer | ( | YY_BUFFER_STATE | b, |
yyscan_t | yyscanner | ||
) |
Referenced by cogadb_sql_scanner_lex_destroy(), cogadb_sql_scanner_pop_buffer_state(), CoGaDB::SQL::Driver::destroy_scan(), and CoGaDB::SQL::Driver::set_input().
void cogadb_sql_scanner__flush_buffer | ( | YY_BUFFER_STATE | b, |
yyscan_t | yyscanner | ||
) |
Discard all buffered characters. On the next scan, YY_INPUT will be called.
b | the buffer state to be flushed, usually YY_CURRENT_BUFFER . |
yyscanner | The scanner object. |
References cogadb_sql_scanner__load_buffer_state(), yy_buffer_state::yy_at_bol, yy_buffer_state::yy_buf_pos, YY_BUFFER_NEW, yy_buffer_state::yy_buffer_status, yy_buffer_state::yy_ch_buf, YY_CURRENT_BUFFER, YY_END_OF_BUFFER_CHAR, and yy_buffer_state::yy_n_chars.
Referenced by cogadb_sql_scanner__init_buffer().
static void cogadb_sql_scanner__init_buffer | ( | YY_BUFFER_STATE | b, |
FILE * | file, | ||
yyscan_t | yyscanner | ||
) | [static] |
The main scanner function which does all the work.
References cogadb_sql_scanner__flush_buffer(), yy_buffer_state::yy_bs_column, yy_buffer_state::yy_bs_lineno, YY_CURRENT_BUFFER, yy_buffer_state::yy_fill_buffer, yy_buffer_state::yy_input_file, and yy_buffer_state::yy_is_interactive.
static void cogadb_sql_scanner__load_buffer_state | ( | yyscan_t | yyscanner | ) | [static] |
Referenced by cogadb_sql_scanner__flush_buffer(), cogadb_sql_scanner_pop_buffer_state(), and cogadb_sql_scanner_push_buffer_state().
YY_BUFFER_STATE cogadb_sql_scanner__scan_buffer | ( | char * | base, |
yy_size_t | size, | ||
yyscan_t | yyscanner | ||
) |
Setup the input buffer state to scan directly from a user-specified character buffer.
base | the character buffer |
size | the size in bytes of the character buffer |
yyscanner | The scanner object. |
References cogadb_sql_scanner__switch_to_buffer(), cogadb_sql_scanner_alloc(), yy_buffer_state::yy_at_bol, yy_buffer_state::yy_buf_pos, yy_buffer_state::yy_buf_size, YY_BUFFER_NEW, yy_buffer_state::yy_buffer_status, yy_buffer_state::yy_ch_buf, YY_END_OF_BUFFER_CHAR, YY_FATAL_ERROR, yy_buffer_state::yy_fill_buffer, yy_buffer_state::yy_input_file, yy_buffer_state::yy_is_interactive, yy_buffer_state::yy_is_our_buffer, and yy_buffer_state::yy_n_chars.
Referenced by cogadb_sql_scanner__scan_bytes().
YY_BUFFER_STATE cogadb_sql_scanner__scan_bytes | ( | yyconst char * | yybytes, |
int | _yybytes_len, | ||
yyscan_t | yyscanner | ||
) |
Setup the input buffer state to scan the given bytes. The next call to cogadb_sql_scanner_lex() will scan from a copy of bytes.
yybytes | the byte buffer to scan |
_yybytes_len | the number of bytes in the buffer pointed to by bytes. |
yyscanner | The scanner object. |
References cogadb_sql_scanner__scan_buffer(), cogadb_sql_scanner_alloc(), YY_END_OF_BUFFER_CHAR, YY_FATAL_ERROR, and yy_buffer_state::yy_is_our_buffer.
Referenced by cogadb_sql_scanner__scan_string().
YY_BUFFER_STATE cogadb_sql_scanner__scan_string | ( | yyconst char * | yystr, |
yyscan_t | yyscanner | ||
) |
Setup the input buffer state to scan a string. The next call to cogadb_sql_scanner_lex() will scan from a copy of str.
yystr | a NUL-terminated string to scan |
yyscanner | The scanner object. |
References cogadb_sql_scanner__scan_bytes().
Referenced by CoGaDB::SQL::Driver::set_input().
void cogadb_sql_scanner__switch_to_buffer | ( | YY_BUFFER_STATE | new_buffer, |
yyscan_t | yyscanner | ||
) |
Referenced by cogadb_sql_scanner__scan_buffer(), and CoGaDB::SQL::Driver::set_input().
void * cogadb_sql_scanner_alloc | ( | yy_size_t | size, |
yyscan_t | yyscanner | ||
) |
Referenced by cogadb_sql_scanner__scan_buffer(), cogadb_sql_scanner__scan_bytes(), cogadb_sql_scanner_ensure_buffer_stack(), cogadb_sql_scanner_lex_init(), and cogadb_sql_scanner_lex_init_extra().
static void cogadb_sql_scanner_ensure_buffer_stack | ( | yyscan_t | yyscanner | ) | [static] |
References cogadb_sql_scanner_alloc(), cogadb_sql_scanner_realloc(), yyguts_t::yy_buffer_stack, yyguts_t::yy_buffer_stack_max, yyguts_t::yy_buffer_stack_top, and YY_FATAL_ERROR.
Referenced by cogadb_sql_scanner_push_buffer_state().
void cogadb_sql_scanner_free | ( | void * | ptr, |
yyscan_t | yyscanner | ||
) |
int cogadb_sql_scanner_get_column | ( | yyscan_t | yyscanner | ) |
Get the current column number.
yyscanner | The scanner object. |
References YY_CURRENT_BUFFER, and yycolumn.
int cogadb_sql_scanner_get_debug | ( | yyscan_t | yyscanner | ) |
References yy_flex_debug.
YY_EXTRA_TYPE cogadb_sql_scanner_get_extra | ( | yyscan_t | yyscanner | ) |
Get the user-defined data for this scanner.
yyscanner | The scanner object. |
References yyextra.
FILE * cogadb_sql_scanner_get_in | ( | yyscan_t | yyscanner | ) |
int cogadb_sql_scanner_get_leng | ( | yyscan_t | yyscanner | ) |
int cogadb_sql_scanner_get_lineno | ( | yyscan_t | yyscanner | ) |
Get the current line number.
yyscanner | The scanner object. |
References YY_CURRENT_BUFFER, and yylineno.
Referenced by CoGaDB::SQL::Driver::error().
YYSTYPE * cogadb_sql_scanner_get_lval | ( | yyscan_t | yyscanner | ) |
References yylval.
FILE * cogadb_sql_scanner_get_out | ( | yyscan_t | yyscanner | ) |
char * cogadb_sql_scanner_get_text | ( | yyscan_t | yyscanner | ) |
int cogadb_sql_scanner_lex_destroy | ( | yyscan_t | yyscanner | ) |
References cogadb_sql_scanner__delete_buffer(), cogadb_sql_scanner_free(), cogadb_sql_scanner_pop_buffer_state(), yyguts_t::yy_buffer_stack, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yy_init_globals(), and yyguts_t::yy_start_stack.
Referenced by CoGaDB::SQL::Driver::destroy_scan().
int cogadb_sql_scanner_lex_init | ( | yyscan_t * | scanner | ) |
References cogadb_sql_scanner_alloc(), and yy_init_globals().
int cogadb_sql_scanner_lex_init_extra | ( | YY_EXTRA_TYPE | user_defined, |
yyscan_t * | scanner | ||
) |
References cogadb_sql_scanner_alloc(), cogadb_sql_scanner_set_extra(), and yy_init_globals().
Referenced by CoGaDB::SQL::Driver::init_scan().
void cogadb_sql_scanner_pop_buffer_state | ( | yyscan_t | yyscanner | ) |
Removes and deletes the top of the stack, if present. The next element becomes the new top.
yyscanner | The scanner object. |
References cogadb_sql_scanner__delete_buffer(), cogadb_sql_scanner__load_buffer_state(), yyguts_t::yy_buffer_stack_top, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, and yyguts_t::yy_did_buffer_switch_on_eof.
Referenced by cogadb_sql_scanner_lex_destroy().
void cogadb_sql_scanner_push_buffer_state | ( | YY_BUFFER_STATE | new_buffer, |
yyscan_t | yyscanner | ||
) |
Pushes the new state onto the stack. The new state becomes the current state. This function will allocate the stack if necessary.
new_buffer | The new state. |
yyscanner | The scanner object. |
References cogadb_sql_scanner__load_buffer_state(), cogadb_sql_scanner_ensure_buffer_stack(), yyguts_t::yy_buffer_stack_top, yyguts_t::yy_c_buf_p, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yyguts_t::yy_did_buffer_switch_on_eof, yyguts_t::yy_hold_char, and yyguts_t::yy_n_chars.
void * cogadb_sql_scanner_realloc | ( | void * | ptr, |
yy_size_t | size, | ||
yyscan_t | yyscanner | ||
) |
void cogadb_sql_scanner_restart | ( | FILE * | input_file, |
yyscan_t | yyscanner | ||
) |
void cogadb_sql_scanner_set_column | ( | int | column_no, |
yyscan_t | yyscanner | ||
) |
Set the current column.
line_number | |
yyscanner | The scanner object. |
References YY_CURRENT_BUFFER, yy_fatal_error(), and yycolumn.
void cogadb_sql_scanner_set_debug | ( | int | debug_flag, |
yyscan_t | yyscanner | ||
) |
References yy_flex_debug.
void cogadb_sql_scanner_set_extra | ( | YY_EXTRA_TYPE | user_defined, |
yyscan_t | yyscanner | ||
) |
Set the user-defined data. This data is never touched by the scanner.
user_defined | The data to be associated with this scanner. |
yyscanner | The scanner object. |
References yyextra.
Referenced by cogadb_sql_scanner_lex_init_extra().
void cogadb_sql_scanner_set_in | ( | FILE * | in_str, |
yyscan_t | yyscanner | ||
) |
Set the input stream. This does not discard the current input buffer.
in_str | A readable stream. |
yyscanner | The scanner object. |
References yyin.
void cogadb_sql_scanner_set_lineno | ( | int | line_number, |
yyscan_t | yyscanner | ||
) |
Set the current line number.
line_number | |
yyscanner | The scanner object. |
References YY_CURRENT_BUFFER, yy_fatal_error(), and yylineno.
void cogadb_sql_scanner_set_lval | ( | YYSTYPE * | yylval_param, |
yyscan_t | yyscanner | ||
) |
References yylval.
void cogadb_sql_scanner_set_out | ( | FILE * | out_str, |
yyscan_t | yyscanner | ||
) |
References yyout.
static void yy_fatal_error | ( | yyconst char | msg[], |
yyscan_t | yyscanner | ||
) | [static] |
Referenced by cogadb_sql_scanner_set_column(), and cogadb_sql_scanner_set_lineno().
static void yy_fatal_error | ( | yyconst char * | msg, |
yyscan_t | yyscanner | ||
) | [static] |
References YY_EXIT_FAILURE.
static int yy_get_next_buffer | ( | yyscan_t | yyscanner | ) | [static] |
static yy_state_type yy_get_previous_state | ( | yyscan_t | yyscanner | ) | [static] |
static int yy_init_globals | ( | yyscan_t | yyscanner | ) | [static] |
References yyguts_t::yy_buffer_stack, yyguts_t::yy_buffer_stack_max, yyguts_t::yy_buffer_stack_top, yyguts_t::yy_c_buf_p, yyguts_t::yy_init, yyguts_t::yy_start, yyguts_t::yy_start_stack, yyguts_t::yy_start_stack_depth, yyguts_t::yy_start_stack_ptr, yyin, and yyout.
Referenced by cogadb_sql_scanner_lex_destroy(), cogadb_sql_scanner_lex_init(), and cogadb_sql_scanner_lex_init_extra().
static yy_state_type yy_try_NUL_trans | ( | yy_state_type | current_state, |
yyscan_t | yyscanner | ||
) | [static] |
yyconst flex_int16_t yy_accept[453] [static] |
yyconst flex_int16_t yy_base[457] [static] |
yyconst flex_int16_t yy_chk[989] [static] |
yyconst flex_int16_t yy_def[457] [static] |
yyconst flex_int32_t yy_ec[256] [static] |
yyconst flex_int32_t yy_meta[68] [static] |
{ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }
yyconst flex_int16_t yy_nxt[989] [static] |
yyconst flex_int32_t yy_rule_can_match_eol[118] [static] |
{ 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, }