8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 10:03:03 +01:00
firebird-mirror/builds/win32/parse.bat
Adriano dos Santos Fernandes f864a6d68a Removed all KW_ prefixes from parse.y and adds by script TOK_ prefix to all #define tokens generated by btyacc.
This change is done because using strongly-typed C++11 enums, prefixes are removed from enum items
(as they're scoped) and that has a big tendency to clash with generated parser defines.

Windows build untested.
2016-09-23 15:12:13 -03:00

30 lines
689 B
Batchfile

@echo off
@echo.
@call setenvvar.bat
@if errorlevel 1 (goto :END)
@call set_build_target.bat %*
@echo Generating parse.cpp and dsql.tab.h
@sed -n "/%%type .*/p" < %FB_ROOT_PATH%\src\dsql\parse.y > types.y
@sed "s/%%type .*//" < %FB_ROOT_PATH%\src\dsql\parse.y > y.y
%FB_ROOT_PATH%\temp\%FB_OBJ_DIR%\btyacc\btyacc -l -d -S %FB_ROOT_PATH%\src\dsql\btyacc_fb.ske y.y
@if errorlevel 1 (exit /B 1)
@sed -i "s/#define \([A-Z].*\)/#define TOK_\1/" y_tab.h
@sed -i "s/#define TOK_YY\(.*\)/#define YY\1/" y_tab.h
@copy y_tab.h %FB_ROOT_PATH%\src\include\gen\parse.h > nul
@copy y_tab.c %FB_ROOT_PATH%\src\dsql\parse.cpp > nul
@del y.y
@del types.y
@del y_tab.h
@del y_tab.c
@del sed*
:END