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 () const
char yyPeek () const
char yyPeekn (int n) const
void yyUnget ()
void yySkip ()
void yySkipn (int n)
bool eof () const
bool eof (int n) const
const char * get_buf () const
const char * get_cpp_buf () const
const char * get_end_of_query () const
void start_token ()
void restart_token ()
const char * get_tok_start () const
const char * get_cpp_tok_start () const
const char * get_tok_end () const
const char * get_cpp_tok_end () const
const char * get_tok_start_prev () const
const char * get_ptr () const
const char * get_cpp_ptr () const
uint32_t yyLength () const
const char * get_body_utf8_str () const
uint32_t get_body_utf8_length () const
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 (str_ref, 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 38 of file lex_input_stream.h.


Member Function Documentation

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.

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 147 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 120 of file sql_lex.cc.

void drizzled::Lex_input_stream::body_utf8_append_literal ( str_ref  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 163 of file sql_lex.cc.

bool drizzled::Lex_input_stream::eof ( ) const
inline

End of file indicator for the query text to parse.

Returns:
true if there are no more characters to parse

Definition at line 148 of file lex_input_stream.h.

References m_end_of_query, and m_ptr.

bool drizzled::Lex_input_stream::eof ( int  n) const
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 158 of file lex_input_stream.h.

References m_end_of_query, and m_ptr.

uint32_t drizzled::Lex_input_stream::get_body_utf8_length ( ) const
inline

Get the utf8-body length.

Definition at line 263 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 ( ) const
inline

Get the utf8-body string.

Definition at line 257 of file lex_input_stream.h.

References m_body_utf8.

const char* drizzled::Lex_input_stream::get_buf ( ) const
inline

Get the raw query buffer.

Definition at line 164 of file lex_input_stream.h.

References m_buf.

const char* drizzled::Lex_input_stream::get_cpp_buf ( ) const
inline

Get the pre-processed query buffer.

Definition at line 170 of file lex_input_stream.h.

References m_cpp_buf.

const char* drizzled::Lex_input_stream::get_cpp_ptr ( ) const
inline

Get the current stream pointer, in the pre-processed buffer.

Definition at line 240 of file lex_input_stream.h.

References m_cpp_ptr.

const char* drizzled::Lex_input_stream::get_cpp_tok_end ( ) const
inline

Get the token end position, in the pre-processed buffer.

Definition at line 222 of file lex_input_stream.h.

References m_cpp_tok_end.

const char* drizzled::Lex_input_stream::get_cpp_tok_start ( ) const
inline

Get the token start position, in the pre-processed buffer.

Definition at line 210 of file lex_input_stream.h.

References m_cpp_tok_start.

const char* drizzled::Lex_input_stream::get_end_of_query ( ) const
inline

Get the end of the raw query buffer.

Definition at line 176 of file lex_input_stream.h.

References m_end_of_query.

const char* drizzled::Lex_input_stream::get_ptr ( ) const
inline

Get the current stream pointer, in the raw buffer.

Definition at line 234 of file lex_input_stream.h.

References m_ptr.

const char* drizzled::Lex_input_stream::get_tok_end ( ) const
inline

Get the token end position, in the raw buffer.

Definition at line 216 of file lex_input_stream.h.

References m_tok_end.

const char* drizzled::Lex_input_stream::get_tok_start ( ) const
inline

Get the token start position, in the raw buffer.

Definition at line 204 of file lex_input_stream.h.

References m_tok_start.

const char* drizzled::Lex_input_stream::get_tok_start_prev ( ) const
inline

Get the previous token start position, in the raw buffer.

Definition at line 228 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 197 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 50 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 59 of file lex_input_stream.h.

References m_cpp_ptr, m_echo, and m_ptr.

void drizzled::Lex_input_stream::start_token ( )
inline

Mark the stream position as the start of a new token.

Definition at line 182 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.

Returns:
the next character to parse.

Definition at line 73 of file lex_input_stream.h.

References m_cpp_ptr, m_echo, and m_ptr.

char drizzled::Lex_input_stream::yyGetLast ( ) const
inline

Get the last character accepted.

Returns:
the last character accepted.

Definition at line 85 of file lex_input_stream.h.

References m_ptr.

uint32_t drizzled::Lex_input_stream::yyLength ( ) const
inline

Get the length of the current token, in the raw buffer.

Definition at line 246 of file lex_input_stream.h.

References m_ptr, and m_tok_start.

char drizzled::Lex_input_stream::yyPeek ( ) const
inline

Look at the next character to parse, but do not accept it.

Definition at line 93 of file lex_input_stream.h.

References m_ptr.

char drizzled::Lex_input_stream::yyPeekn ( int  n) const
inline

Look ahead at some character to parse.

Parameters:
noffset of the character to look up

Definition at line 102 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 122 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 134 of file lex_input_stream.h.

References m_cpp_ptr, m_echo, and m_ptr.

void drizzled::Lex_input_stream::yyUnget ( )
inline

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 112 of file lex_input_stream.h.

References m_cpp_ptr, m_echo, and m_ptr.


Member Data Documentation

bool drizzled::Lex_input_stream::ignore_space

SQL_MODE = IGNORE_SPACE.

Definition at line 360 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 363 of file lex_input_stream.h.

int drizzled::Lex_input_stream::lookahead_token

LALR(2) resolution, look ahead token.

Definition at line 285 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 288 of file lex_input_stream.h.

char* drizzled::Lex_input_stream::m_body_utf8
private

UTF8-body buffer created during parsing.

Definition at line 340 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 343 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 307 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 310 of file lex_input_stream.h.

char* drizzled::Lex_input_stream::m_cpp_buf
private

Pre-processed buffer.

Definition at line 316 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 319 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 379 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 371 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 337 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 325 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 331 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 349 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 313 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 301 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 292 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().

Session* drizzled::Lex_input_stream::m_session

Current thread.

Definition at line 273 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 298 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 295 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 304 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 354 of file lex_input_stream.h.

unsigned char drizzled::Lex_input_stream::tok_bitmap

Token character bitmaps, to detect 7bit strings.

Definition at line 357 of file lex_input_stream.h.

uint32_t drizzled::Lex_input_stream::yylineno

Current line number.

Definition at line 276 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 282 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 279 of file lex_input_stream.h.


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