-
Gleb Shchepa authored
This is a pure refactoring task. There is a very long union type YYSTYPE in sql_lex.h. The value of that type is shared between the SQL parser (Bison grammar in sql_yacc.yy) and the lexical scanner (sql_lex.{h,cc}). A very small part of that type's declaration is used to return data from the scanner to the parser -- the large rest is intended to pass intermediate semantic values between parser's grammar rules. Obviously, the lexical scanner does nothing with those parser's intermediate stuff, however sql_lex.h has to include many extra header files and/or make a lot of forward declarations to continue compile. Also, files like sql_digest.cc and sql_lex_hints.h had to include sql_lex.h just to access that tiny scanner-specific subset of YYSTYPE. The current patch has introduced a separate header file lexer_yystype.h with a small union type Lexer_yystype inside to maintain there scanner-specific data only. Also it has removed references to the whole sql_lex.h from sql_digest.cc and sql_lex_hints.h. Change-Id: Id4a9795583350ffc2d94df151df35339fa8ba794
Gleb Shchepa authoredThis is a pure refactoring task. There is a very long union type YYSTYPE in sql_lex.h. The value of that type is shared between the SQL parser (Bison grammar in sql_yacc.yy) and the lexical scanner (sql_lex.{h,cc}). A very small part of that type's declaration is used to return data from the scanner to the parser -- the large rest is intended to pass intermediate semantic values between parser's grammar rules. Obviously, the lexical scanner does nothing with those parser's intermediate stuff, however sql_lex.h has to include many extra header files and/or make a lot of forward declarations to continue compile. Also, files like sql_digest.cc and sql_lex_hints.h had to include sql_lex.h just to access that tiny scanner-specific subset of YYSTYPE. The current patch has introduced a separate header file lexer_yystype.h with a small union type Lexer_yystype inside to maintain there scanner-specific data only. Also it has removed references to the whole sql_lex.h from sql_digest.cc and sql_lex_hints.h. Change-Id: Id4a9795583350ffc2d94df151df35339fa8ba794
Loading