Public Member Functions | |
Lex_input_stream (Session *session, const char *buff, unsigned int length) | |
void | set_echo (bool echo) |
void | skip_binary (int n) |
char | yyGet () |
char | yyGetLast () |
char | yyPeek () |
char | yyPeekn (int n) |
void | yyUnget () |
void | yySkip () |
void | yySkipn (int n) |
bool | eof () |
bool | eof (int n) |
const char * | get_buf () |
const char * | get_cpp_buf () |
const char * | get_end_of_query () |
void | start_token () |
void | restart_token () |
const char * | get_tok_start () |
const char * | get_cpp_tok_start () |
const char * | get_tok_end () |
const char * | get_cpp_tok_end () |
const char * | get_tok_start_prev () |
const char * | get_ptr () |
const char * | get_cpp_ptr () |
uint32_t | yyLength () |
const char * | get_body_utf8_str () |
uint32_t | get_body_utf8_length () |
void | body_utf8_start (Session *session, const char *begin_ptr) |
void | body_utf8_append (const char *ptr) |
void | body_utf8_append (const char *ptr, const char *end_ptr) |
The operation appends unprocessed part of pre-processed buffer till the given pointer (ptr) and sets m_cpp_utf8_processed_ptr to end_ptr. | |
void | body_utf8_append_literal (const LEX_STRING *txt, const char *end_ptr) |
Public Attributes | |
Session * | m_session |
uint32_t | yylineno |
uint32_t | yytoklen |
LEX_YYSTYPE | yylval |
int | lookahead_token |
LEX_YYSTYPE | lookahead_yylval |
enum my_lex_states | next_state |
unsigned char | tok_bitmap |
bool | ignore_space |
enum_comment_state | in_comment |
const char * | m_cpp_text_start |
const char * | m_cpp_text_end |
Private Attributes | |
const char * | m_ptr |
const char * | m_tok_start |
const char * | m_tok_end |
const char * | m_end_of_query |
const char * | m_tok_start_prev |
const char * | m_buf |
uint32_t | m_buf_length |
bool | m_echo |
char * | m_cpp_buf |
char * | m_cpp_ptr |
const char * | m_cpp_tok_start |
const char * | m_cpp_tok_start_prev |
const char * | m_cpp_tok_end |
char * | m_body_utf8 |
char * | m_body_utf8_ptr |
const char * | m_cpp_utf8_processed_ptr |
Definition at line 39 of file lex_input_stream.h.
void drizzled::Lex_input_stream::body_utf8_append | ( | const char * | ptr | ) |
The operation appends unprocessed part of the pre-processed buffer till the given pointer (ptr) and sets m_cpp_utf8_processed_ptr to ptr.
ptr | Pointer in the pre-processed buffer, which specifies the end of the chunk, which should be appended to the utf8 body. |
Definition at line 186 of file sql_lex.cc.
void drizzled::Lex_input_stream::body_utf8_append | ( | const char * | ptr, |
const char * | end_ptr | ||
) |
The operation appends unprocessed part of pre-processed buffer till the given pointer (ptr) and sets m_cpp_utf8_processed_ptr to end_ptr.
The idea is that some tokens in the pre-processed buffer (like character set introducers) should be skipped.
Example: CPP buffer: SELECT 'str1', _latin1 'str2'; m_cpp_utf8_processed_ptr -- points at the "SELECT ..."; In order to skip "_latin1", the following call should be made: body_utf8_append(<pointer to "_latin1 ...">, <pointer to " 'str2'...">)
ptr | Pointer in the pre-processed buffer, which specifies the end of the chunk, which should be appended to the utf8 body. |
end_ptr | Pointer in the pre-processed buffer, to which m_cpp_utf8_processed_ptr will be set in the end of the operation. |
Definition at line 158 of file sql_lex.cc.
void drizzled::Lex_input_stream::body_utf8_append_literal | ( | const LEX_STRING * | txt, |
const char * | end_ptr | ||
) |
The operation converts the specified text literal to the utf8 and appends the result to the utf8-body.
session | Thread context. |
txt | Text literal. |
txt_cs | Character set of the text literal. |
end_ptr | Pointer in the pre-processed buffer, to which m_cpp_utf8_processed_ptr will be set in the end of the operation. |
Definition at line 202 of file sql_lex.cc.
void drizzled::Lex_input_stream::body_utf8_start | ( | Session * | session, |
const char * | begin_ptr | ||
) |
The operation is called from the parser in order to 1) designate the intention to have utf8 body; 1) Indicate to the lexer that we will need a utf8 representation of this statement; 2) Determine the beginning of the body.
session | Thread context. |
begin_ptr | Pointer to the start of the body in the pre-processed buffer. |
Definition at line 122 of file sql_lex.cc.
bool drizzled::Lex_input_stream::eof | ( | ) | [inline] |
End of file indicator for the query text to parse.
Definition at line 150 of file lex_input_stream.h.
References m_end_of_query, and m_ptr.
bool drizzled::Lex_input_stream::eof | ( | int | n | ) | [inline] |
End of file indicator for the query text to parse.
n | number of characters expected |
Definition at line 160 of file lex_input_stream.h.
References m_end_of_query, and m_ptr.
uint32_t drizzled::Lex_input_stream::get_body_utf8_length | ( | ) | [inline] |
Get the utf8-body length.
Definition at line 265 of file lex_input_stream.h.
References m_body_utf8, and m_body_utf8_ptr.
const char* drizzled::Lex_input_stream::get_body_utf8_str | ( | ) | [inline] |
Get the utf8-body string.
Definition at line 259 of file lex_input_stream.h.
References m_body_utf8.
const char* drizzled::Lex_input_stream::get_buf | ( | ) | [inline] |
const char* drizzled::Lex_input_stream::get_cpp_buf | ( | ) | [inline] |
Get the pre-processed query buffer.
Definition at line 172 of file lex_input_stream.h.
References m_cpp_buf.
const char* drizzled::Lex_input_stream::get_cpp_ptr | ( | ) | [inline] |
Get the current stream pointer, in the pre-processed buffer.
Definition at line 242 of file lex_input_stream.h.
References m_cpp_ptr.
const char* drizzled::Lex_input_stream::get_cpp_tok_end | ( | ) | [inline] |
Get the token end position, in the pre-processed buffer.
Definition at line 224 of file lex_input_stream.h.
References m_cpp_tok_end.
const char* drizzled::Lex_input_stream::get_cpp_tok_start | ( | ) | [inline] |
Get the token start position, in the pre-processed buffer.
Definition at line 212 of file lex_input_stream.h.
References m_cpp_tok_start.
const char* drizzled::Lex_input_stream::get_end_of_query | ( | ) | [inline] |
Get the end of the raw query buffer.
Definition at line 178 of file lex_input_stream.h.
References m_end_of_query.
const char* drizzled::Lex_input_stream::get_ptr | ( | ) | [inline] |
Get the current stream pointer, in the raw buffer.
Definition at line 236 of file lex_input_stream.h.
References m_ptr.
const char* drizzled::Lex_input_stream::get_tok_end | ( | ) | [inline] |
Get the token end position, in the raw buffer.
Definition at line 218 of file lex_input_stream.h.
References m_tok_end.
const char* drizzled::Lex_input_stream::get_tok_start | ( | ) | [inline] |
Get the token start position, in the raw buffer.
Definition at line 206 of file lex_input_stream.h.
References m_tok_start.
const char* drizzled::Lex_input_stream::get_tok_start_prev | ( | ) | [inline] |
Get the previous token start position, in the raw buffer.
Definition at line 230 of file lex_input_stream.h.
References m_tok_start_prev.
void drizzled::Lex_input_stream::restart_token | ( | ) | [inline] |
Adjust the starting position of the current token. This is used to compensate for starting whitespace.
Definition at line 199 of file lex_input_stream.h.
References m_cpp_ptr, m_cpp_tok_start, m_ptr, and m_tok_start.
void drizzled::Lex_input_stream::set_echo | ( | bool | echo | ) | [inline] |
Set the echo mode.
When echo is true, characters parsed from the raw input stream are preserved. When false, characters parsed are silently ignored.
echo | the echo mode. |
Definition at line 52 of file lex_input_stream.h.
References m_echo.
void drizzled::Lex_input_stream::skip_binary | ( | int | n | ) | [inline] |
Skip binary from the input stream.
n | number of bytes to accept. |
Definition at line 61 of file lex_input_stream.h.
void drizzled::Lex_input_stream::start_token | ( | ) | [inline] |
Mark the stream position as the start of a new token.
Definition at line 184 of file lex_input_stream.h.
References m_cpp_ptr, m_cpp_tok_end, m_cpp_tok_start, m_cpp_tok_start_prev, m_ptr, m_tok_end, m_tok_start, and m_tok_start_prev.
char drizzled::Lex_input_stream::yyGet | ( | ) | [inline] |
Get a character, and advance in the stream.
Definition at line 75 of file lex_input_stream.h.
char drizzled::Lex_input_stream::yyGetLast | ( | ) | [inline] |
Get the last character accepted.
Definition at line 87 of file lex_input_stream.h.
References m_ptr.
uint32_t drizzled::Lex_input_stream::yyLength | ( | ) | [inline] |
Get the length of the current token, in the raw buffer.
Definition at line 248 of file lex_input_stream.h.
References m_ptr, and m_tok_start.
char drizzled::Lex_input_stream::yyPeek | ( | ) | [inline] |
Look at the next character to parse, but do not accept it.
Definition at line 95 of file lex_input_stream.h.
References m_ptr.
char drizzled::Lex_input_stream::yyPeekn | ( | int | n | ) | [inline] |
Look ahead at some character to parse.
n | offset of the character to look up |
Definition at line 104 of file lex_input_stream.h.
References m_ptr.
void drizzled::Lex_input_stream::yySkip | ( | ) | [inline] |
Accept a character, by advancing the input stream.
Definition at line 124 of file lex_input_stream.h.
void drizzled::Lex_input_stream::yySkipn | ( | int | n | ) | [inline] |
Accept multiple characters at once.
n | the number of characters to accept. |
Definition at line 136 of file lex_input_stream.h.
void drizzled::Lex_input_stream::yyUnget | ( | ) | [inline] |
SQL_MODE = IGNORE_SPACE.
Definition at line 364 of file lex_input_stream.h.
enum_comment_state drizzled::Lex_input_stream::in_comment |
State of the lexical analyser for comments.
Definition at line 367 of file lex_input_stream.h.
LALR(2) resolution, look ahead token.
Definition at line 289 of file lex_input_stream.h.
LEX_YYSTYPE drizzled::Lex_input_stream::lookahead_yylval |
LALR(2) resolution, value of the look ahead token.
Definition at line 292 of file lex_input_stream.h.
char* drizzled::Lex_input_stream::m_body_utf8 [private] |
UTF8-body buffer created during parsing.
Definition at line 344 of file lex_input_stream.h.
Referenced by get_body_utf8_length(), and get_body_utf8_str().
char* drizzled::Lex_input_stream::m_body_utf8_ptr [private] |
Pointer to the current position in the UTF8-body buffer.
Definition at line 347 of file lex_input_stream.h.
Referenced by get_body_utf8_length().
const char* drizzled::Lex_input_stream::m_buf [private] |
Begining of the query text in the input stream, in the raw buffer.
Definition at line 311 of file lex_input_stream.h.
Referenced by get_buf().
uint32_t drizzled::Lex_input_stream::m_buf_length [private] |
Length of the raw buffer.
Definition at line 314 of file lex_input_stream.h.
char* drizzled::Lex_input_stream::m_cpp_buf [private] |
Pre-processed buffer.
Definition at line 320 of file lex_input_stream.h.
Referenced by get_cpp_buf().
char* drizzled::Lex_input_stream::m_cpp_ptr [private] |
Pointer to the current position in the pre-processed input stream.
Definition at line 323 of file lex_input_stream.h.
Referenced by get_cpp_ptr(), restart_token(), skip_binary(), start_token(), yyGet(), yySkip(), yySkipn(), and yyUnget().
const char* drizzled::Lex_input_stream::m_cpp_text_end |
Ending position of the TEXT_STRING or IDENT in the pre-processed buffer.
NOTE: this member must be used within base_sql_lex() function only.
Definition at line 383 of file lex_input_stream.h.
const char* drizzled::Lex_input_stream::m_cpp_text_start |
Starting position of the TEXT_STRING or IDENT in the pre-processed buffer.
NOTE: this member must be used within base_sql_lex() function only.
Definition at line 375 of file lex_input_stream.h.
const char* drizzled::Lex_input_stream::m_cpp_tok_end [private] |
Ending position of the previous token parsed, in the pre-processed buffer.
Definition at line 341 of file lex_input_stream.h.
Referenced by get_cpp_tok_end(), and start_token().
const char* drizzled::Lex_input_stream::m_cpp_tok_start [private] |
Starting position of the last token parsed, in the pre-processed buffer.
Definition at line 329 of file lex_input_stream.h.
Referenced by get_cpp_tok_start(), restart_token(), and start_token().
const char* drizzled::Lex_input_stream::m_cpp_tok_start_prev [private] |
Starting position of the previous token parsed, in the pre-procedded buffer.
Definition at line 335 of file lex_input_stream.h.
Referenced by start_token().
const char* drizzled::Lex_input_stream::m_cpp_utf8_processed_ptr [private] |
Position in the pre-processed buffer. The query from m_cpp_buf to m_cpp_utf_processed_ptr is converted to UTF8-body.
Definition at line 353 of file lex_input_stream.h.
bool drizzled::Lex_input_stream::m_echo [private] |
Echo the parsed stream to the pre-processed buffer.
Definition at line 317 of file lex_input_stream.h.
Referenced by set_echo(), skip_binary(), yyGet(), yySkip(), yySkipn(), and yyUnget().
const char* drizzled::Lex_input_stream::m_end_of_query [private] |
End of the query text in the input stream, in the raw buffer.
Definition at line 305 of file lex_input_stream.h.
Referenced by eof(), and get_end_of_query().
const char* drizzled::Lex_input_stream::m_ptr [private] |
Pointer to the current position in the raw input stream.
Definition at line 296 of file lex_input_stream.h.
Referenced by eof(), get_ptr(), restart_token(), skip_binary(), start_token(), yyGet(), yyGetLast(), yyLength(), yyPeek(), yyPeekn(), yySkip(), yySkipn(), and yyUnget().
Current thread.
Definition at line 277 of file lex_input_stream.h.
const char* drizzled::Lex_input_stream::m_tok_end [private] |
Ending position of the previous token parsed, in the raw buffer.
Definition at line 302 of file lex_input_stream.h.
Referenced by get_tok_end(), and start_token().
const char* drizzled::Lex_input_stream::m_tok_start [private] |
Starting position of the last token parsed, in the raw buffer.
Definition at line 299 of file lex_input_stream.h.
Referenced by get_tok_start(), restart_token(), start_token(), and yyLength().
const char* drizzled::Lex_input_stream::m_tok_start_prev [private] |
Starting position of the previous token parsed, in the raw buffer.
Definition at line 308 of file lex_input_stream.h.
Referenced by get_tok_start_prev(), and start_token().
enum my_lex_states drizzled::Lex_input_stream::next_state |
Current state of the lexical analyser.
Definition at line 358 of file lex_input_stream.h.
unsigned char drizzled::Lex_input_stream::tok_bitmap |
Token character bitmaps, to detect 7bit strings.
Definition at line 361 of file lex_input_stream.h.
uint32_t drizzled::Lex_input_stream::yylineno |
Current line number.
Definition at line 280 of file lex_input_stream.h.
LEX_YYSTYPE drizzled::Lex_input_stream::yylval |
Interface with bison, value of the last token parsed.
Definition at line 286 of file lex_input_stream.h.
Referenced by drizzled::check_simple_select().
uint32_t drizzled::Lex_input_stream::yytoklen |
Length of the last token parsed.
Definition at line 283 of file lex_input_stream.h.