blob: 72224f04a8c8a29fed37709149006b9cbea82d29 [file] [log] [blame]
Jeff Cohen4ed1de82005-10-26 05:37:34 +00001@echo off
2rem dobison.cmd prefix mode target source
3rem prefix - passed to bison as -p<prefix>
4rem mode - either debug or release
5rem target - generated parser file name without extension
6rem source - input to bison
Chuck Rose III0ccb9302007-11-21 00:37:56 +00007rem headercopydir - directory to receive a copy of the header
Jeff Cohen4ed1de82005-10-26 05:37:34 +00008
9if "%2"=="debug" (set flags=-tvdo) else (set flags=-vdo)
10
Jeff Cohen53c13b12005-10-27 01:10:36 +000011rem Test for presence of bison.
12bison --help >NUL
13if errorlevel 1 goto nobison
Jeff Cohen4ed1de82005-10-26 05:37:34 +000014
Jeff Cohen53c13b12005-10-27 01:10:36 +000015rem Run bison.
Chuck Rose III0ccb9302007-11-21 00:37:56 +000016echo bison -p%1 %flags%%3.cpp %4
17echo move %3.hpp %3.h
Jeff Cohen53c13b12005-10-27 01:10:36 +000018bison -p%1 %flags%%3.cpp %4 && move %3.hpp %3.h
Chuck Rose III0ccb9302007-11-21 00:37:56 +000019echo copy %3.h %5
20copy %3.h %5
Jeff Cohen53c13b12005-10-27 01:10:36 +000021exit
22
23:nobison
24echo Bison not found. Using pre-generated files.
Chris Lattnerb08b8e62008-01-02 21:30:58 +000025copy %~pn4.cpp.cvs %5\%3.cpp
26copy %~pn4.h.cvs %5\%3.h
Jeff Cohen53c13b12005-10-27 01:10:36 +000027exit