Skip to content

Commit

Permalink
Using the -t command line to bison instead of %name-prefix
Browse files Browse the repository at this point in the history
Needed to compile on machines with older bison versions.
Adding a new parameter "name_prefix" to RUN_BISON() cmake macro.
  • Loading branch information
Alexander Barkov committed Apr 7, 2017
1 parent 191f262 commit 75d1962
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmake/bison.cmake
Expand Up @@ -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)
Expand All @@ -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}
Expand Down
2 changes: 2 additions & 0 deletions sql/CMakeLists.txt
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion sql/sql_yacc.yy
Expand Up @@ -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 }
/*
Expand Down
1 change: 0 additions & 1 deletion sql/sql_yacc_ora.yy
Expand Up @@ -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 }
/*
Expand Down

0 comments on commit 75d1962

Please sign in to comment.