mk_bison.bat 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. @echo off
  2. rem Create flex / bison files, remove absolute pathnames
  3. rem Remember to set SRC and SRCESC when running from a different directory
  4. set SRC=..\..\src
  5. set DEST=%SRC%
  6. set BISON_HAIRY=.\apps\bison.hairy
  7. set BISON_SIMPLE=.\apps\bison.simple
  8. echo flex: quote_fmt_lex.l
  9. flex %SRC%\quote_fmt_lex.l
  10. sed -e "/^#/ s,lex\.yy\.c,quote_fmt_lex.c," "lex.yy.c" > "%DEST%\quote_fmt_lex.c"
  11. echo bison: quote_fmt_parse.y
  12. bison -y -d %SRC%\quote_fmt_parse.y
  13. sed -e "/^#/ s,y\.tab\.c,quote_fmt_parse.c," "y.tab.c" > "%DEST%\quote_fmt_parse.c"
  14. sed -e "/^#/ s,y\.tab\.h,quote_fmt_parse.h," "y.tab.h" > "%DEST%\quote_fmt_parse.h"
  15. echo flex: matcher_parser_lex.l
  16. flex %SRC%\matcher_parser_lex.l
  17. rem sed -e "/^#/ s,%SRCESC%,," "lex.yy.c" > "%DEST%\matcher_parser_lex.c"
  18. sed -e "/^#/ s,lex\.yy\.c,matcher_parser_lex.c," "lex.yy.c" > "%DEST%\matcher_parser_lex.c"
  19. echo bison: matcher_parser_parse.y
  20. bison -y -d %SRC%\matcher_parser_parse.y
  21. sed -e "/^#/ s,y\.tab\.c,matcher_parser_parse.c," "y.tab.c" > "%DEST%\matcher_parser_parse.c"
  22. sed -e "/^#/ s,y\.tab\.h,matcher_parser_parse.h," "y.tab.h" > "%DEST%\matcher_parser_parse.h"
  23. del lex.yy.c
  24. del y.tab.c
  25. del y.tab.h
  26. set BISON_HAIRY=
  27. set BISON_SIMPLE=
  28. set SRC=
  29. set DEST=