Browse Source

Using the -t command line to bison instead of %name-prefix

Needed to compile on machines with older bison versions.
Adding a new parameter "name_prefix" to RUN_BISON() cmake macro.
pull/381/head
Alexander Barkov 9 years ago
parent
commit
75d1962a24
  1. 4
      cmake/bison.cmake
  2. 2
      sql/CMakeLists.txt
  3. 1
      sql/sql_yacc.yy
  4. 1
      sql/sql_yacc_ora.yy

4
cmake/bison.cmake

@ -40,7 +40,7 @@ ELSEIF(BISON_EXECUTABLE AND NOT BISON_USABLE)
ENDIF()
# Use bison to generate C++ and header file
MACRO (RUN_BISON input_yy output_cc output_h)
MACRO (RUN_BISON input_yy output_cc output_h name_prefix)
IF(BISON_TOO_OLD)
IF(EXISTS ${output_cc} AND EXISTS ${output_h})
SET(BISON_USABLE FALSE)
@ -50,7 +50,7 @@ MACRO (RUN_BISON input_yy output_cc output_h)
ADD_CUSTOM_COMMAND(
OUTPUT ${output_cc}
${output_h}
COMMAND ${BISON_EXECUTABLE} -y
COMMAND ${BISON_EXECUTABLE} -y -p ${name_prefix}
--output=${output_cc}
--defines=${output_h}
${input_yy}

2
sql/CMakeLists.txt

@ -279,12 +279,14 @@ RUN_BISON(
${CMAKE_CURRENT_SOURCE_DIR}/sql_yacc.yy
${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc
${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.h
MYSQL
)
RUN_BISON(
${CMAKE_CURRENT_SOURCE_DIR}/sql_yacc_ora.yy
${CMAKE_CURRENT_BINARY_DIR}/sql_yacc_ora.cc
${CMAKE_CURRENT_BINARY_DIR}/sql_yacc_ora.h
ORA
)
# Gen_lex_hash

1
sql/sql_yacc.yy

@ -852,7 +852,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%}
%pure-parser /* We have threads */
%name-prefix "MYSQL"
%parse-param { THD *thd }
%lex-param { THD *thd }
/*

1
sql/sql_yacc_ora.yy

@ -270,7 +270,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%}
%pure-parser /* We have threads */
%name-prefix "ORA"
%parse-param { THD *thd }
%lex-param { THD *thd }
/*

Loading…
Cancel
Save