Jeff Cohen | 4ed1de8 | 2005-10-26 05:37:34 +0000 | [diff] [blame^] | 1 | @echo off |
2 | rem doflex.cmd prefix mode target source | ||||
3 | rem mode - either debug or release | ||||
4 | rem target - generated parser file name without extension | ||||
5 | rem source - input to bison | ||||
6 | |||||
7 | if "%1"=="debug" (set flags=-t) else (set flags=-t) | ||||
8 | |||||
9 | rem Try and run flex. If it is present, great. | ||||
10 | flex %flags% >%2.cpp %3 | ||||
11 | if errorlevel 1 goto error | ||||
12 | goto done | ||||
13 | |||||
14 | :error | ||||
15 | echo Flex could not run. Using pre-generated files. | ||||
16 | copy %~pn3.cpp %2.cpp | ||||
17 | |||||
18 | :done | ||||
19 | exit 0 |