summaryrefslogtreecommitdiff
path: root/win32/doflex.cmd
diff options
context:
space:
mode:
Diffstat (limited to 'win32/doflex.cmd')
-rwxr-xr-xwin32/doflex.cmd19
1 files changed, 19 insertions, 0 deletions
diff --git a/win32/doflex.cmd b/win32/doflex.cmd
new file mode 100755
index 0000000000..5c0629d092
--- /dev/null
+++ b/win32/doflex.cmd
@@ -0,0 +1,19 @@
+@echo off
+rem doflex.cmd prefix mode target source
+rem mode - either debug or release
+rem target - generated parser file name without extension
+rem source - input to bison
+
+if "%1"=="debug" (set flags=-t) else (set flags=-t)
+
+rem Try and run flex. If it is present, great.
+flex %flags% >%2.cpp %3
+if errorlevel 1 goto error
+goto done
+
+:error
+echo Flex could not run. Using pre-generated files.
+copy %~pn3.cpp %2.cpp
+
+:done
+exit 0