diff options
author | Marc Alff <marc.alff@sun.com> | 2008-07-14 19:43:12 -0600 |
---|---|---|
committer | Marc Alff <marc.alff@sun.com> | 2008-07-14 19:43:12 -0600 |
commit | 0add54eccf64843723fb88755fa78fed4fb55886 (patch) | |
tree | 302ecb26a02762cc90a264a5d6a12c76a15939fd /sql/sql_lex.h | |
parent | bee8dcdfee5049fe134427bcee2da6642972e7ec (diff) | |
parent | 6783422136e93d9c198f8d80a924596993b89c91 (diff) | |
download | mariadb-git-0add54eccf64843723fb88755fa78fed4fb55886.tar.gz |
Bug#35577, manual merge mysql-5.0-bugteam -> mysql-5.1-bugteam
Diffstat (limited to 'sql/sql_lex.h')
-rw-r--r-- | sql/sql_lex.h | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 443c85b4854..5af22a895a7 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1513,7 +1513,6 @@ typedef struct st_lex : public Query_tables_list LEX_STRING comment, ident; LEX_USER *grant_user; XID *xid; - uchar* yacc_yyss, *yacc_yyvs; THD *thd; /* maintain a list of used plugins for this LEX */ @@ -1847,6 +1846,59 @@ typedef struct st_lex : public Query_tables_list } } LEX; + +/** + The internal state of the syntax parser. + This object is only available during parsing, + and is private to the syntax parser implementation (sql_yacc.yy). +*/ +class Yacc_state +{ +public: + Yacc_state() + : yacc_yyss(NULL), yacc_yyvs(NULL) + {} + + ~Yacc_state(); + + /** + Bison internal state stack, yyss, when dynamically allocated using + my_yyoverflow(). + */ + uchar *yacc_yyss; + + /** + Bison internal semantic value stack, yyvs, when dynamically allocated using + my_yyoverflow(). + */ + uchar *yacc_yyvs; + + /* + TODO: move more attributes from the LEX structure here. + */ +}; + +/** + Internal state of the parser. + The complete state consist of: + - state data used during lexical parsing, + - state data used during syntactic parsing. +*/ +class Parser_state +{ +public: + Parser_state(THD *thd, const char* buff, unsigned int length) + : m_lip(thd, buff, length), m_yacc() + {} + + ~Parser_state() + {} + + Lex_input_stream m_lip; + Yacc_state m_yacc; +}; + + struct st_lex_local: public st_lex { static void *operator new(size_t size) throw() |