Commit dadb7652 authored by Alexander Barkov's avatar Alexander Barkov

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.
parent 06fede98
......@@ -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}
......
......@@ -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
......
......@@ -854,7 +854,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 }
/*
......
......@@ -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 }
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment