yacc-wrapper.bat 673 B

123456789101112131415161718192021222324252627
  1. @echo on
  2. rem Run yacc such that the working directory is the source root.
  3. rem This is needed for various reasons (e.g. #line references).
  4. rem Do not use directly.
  5. setlocal
  6. rem Use %%~ to strip existing quotes so we can re-quote them safely later.
  7. set "YACC=%~1"
  8. set "PARSER=%~2"
  9. set "IMPLEMENTATION=%~3"
  10. set "HEADER=%~4"
  11. set "ABS_TOP_SRCDIR=%~5"
  12. rem Check for exactly 5 arguments.
  13. if "%~5"=="" (
  14. echo Usage: %~0 YACC PARSER IMPLEMENTATION HEADER ABS_TOP_SRCDIR 1>&2
  15. exit /b 1
  16. )
  17. cd /d "%ABS_TOP_SRCDIR%" || exit /b 1
  18. rem Generate the parser
  19. %YACC% --defines="%HEADER%" ^
  20. --output="%IMPLEMENTATION%" ^
  21. --name-prefix=_xkbcommon_ ^
  22. "%PARSER%"