Drizzled Public API Documentation

drizzled::Lex_input_stream Class Reference

List of all members.

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

Sessionm_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

Detailed Description

Definition at line 39 of file lex_input_stream.h.


Member Function Documentation

The operation appends unprocessed part of the pre-processed buffer till the given pointer (ptr) and sets m_cpp_utf8_processed_ptr to ptr.

Parameters:
ptrPointer 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'...">)

Parameters:
ptrPointer in the pre-processed buffer, which specifies the end of the chunk, which should be appended to the utf8 body.
end_ptrPointer 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.

Parameters:
sessionThread context.
txtText literal.
txt_csCharacter set of the text literal.
end_ptrPointer 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.

Parameters:
sessionThread context.
begin_ptrPointer to the start of the body in the pre-processed buffer.

Definition at line 122 of file sql_lex.cc.

End of file indicator for the query text to parse.

Returns:
true if there are no more characters 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.

Parameters:
nnumber of characters expected
Returns:
true if there are less than n characters to parse

Definition at line 160 of file lex_input_stream.h.

References m_end_of_query, and m_ptr.

Get the utf8-body length.

Definition at line 265 of file lex_input_stream.h.

References m_body_utf8, and m_body_utf8_ptr.

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]

Get the raw query buffer.

Definition at line 166 of file lex_input_stream.h.

References m_buf.

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.

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.

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.

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.

Get the token start position, in the raw buffer.

Definition at line 206 of file lex_input_stream.h.

References m_tok_start.

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.

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.

Parameters:
echothe 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.

Parameters:
nnumber of bytes to accept.

Definition at line 61 of file lex_input_stream.h.

References m_cpp_ptr, m_echo, and m_ptr.

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.

Get a character, and advance in the stream.

Returns:
the next character to parse.

Definition at line 75 of file lex_input_stream.h.

References m_cpp_ptr, m_echo, and m_ptr.

Get the last character accepted.

Returns:
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.

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.

Parameters:
noffset of the character to look up

Definition at line 104 of file lex_input_stream.h.

References m_ptr.

Accept a character, by advancing the input stream.

Definition at line 124 of file lex_input_stream.h.

References m_cpp_ptr, m_echo, and m_ptr.

void drizzled::Lex_input_stream::yySkipn ( int  n) [inline]

Accept multiple characters at once.

Parameters:
nthe number of characters to accept.

Definition at line 136 of file lex_input_stream.h.

References m_cpp_ptr, m_echo, and m_ptr.

Cancel the effect of the last yyGet() or yySkip(). Note that the echo mode should not change between calls to yyGet / yySkip and yyUnget. The caller is responsible for ensuring that.

Definition at line 114 of file lex_input_stream.h.

References m_cpp_ptr, m_echo, and m_ptr.


Member Data Documentation

SQL_MODE = IGNORE_SPACE.

Definition at line 364 of file lex_input_stream.h.

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.

LALR(2) resolution, value of the look ahead token.

Definition at line 292 of file lex_input_stream.h.

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().

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().

Length of the raw buffer.

Definition at line 314 of file lex_input_stream.h.

Pre-processed buffer.

Definition at line 320 of file lex_input_stream.h.

Referenced by get_cpp_buf().

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().

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.

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.

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().

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().

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().

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.

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().

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.

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().

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().

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().

Current state of the lexical analyser.

Definition at line 358 of file lex_input_stream.h.

Token character bitmaps, to detect 7bit strings.

Definition at line 361 of file lex_input_stream.h.

Current line number.

Definition at line 280 of file lex_input_stream.h.

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().

Length of the last token parsed.

Definition at line 283 of file lex_input_stream.h.


The documentation for this class was generated from the following files: