mkl.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/sh -x
  2. #flex dot.l
  3. flex -Sflex.skl dot.l
  4. #flex dphl.l
  5. flex -Sflex.skl dphl.l
  6. echo "generating lexers"
  7. # -d == add debug code
  8. # -8 == generate 8 bits scanner
  9. # -f == fast large scanner
  10. # -R == reentrant lexer for threaded parsing
  11. # --tables-file=vcg.tables.c generates binary table data
  12. flex -Sflex.skl -d -8 -f --yylineno --prefix=vcg --outfile=vcg.flex.c vcg.l
  13. echo "flex 2.6.4 on debian 11 works"
  14. echo "flex 2.6.4 on fedora 34 crashes"
  15. # special skeleton to write only the dfa table data
  16. # after manual edit it is usable for own yylex() routine
  17. # flex -Sflextables.skl -d -8 -f --yylineno --prefix=vcg --outfile=vcg.flextables.c vcg.l
  18. flex --version
  19. bison --version
  20. #
  21. diff -p flex.skl flex-2.6.4.skl >flex-skl-diff.txt
  22. echo "debian 11 has flex 2.6.4"
  23. echo "debian 10 has flex 2.6.4"
  24. echo "fedora 34 has flex version 2.6.4"
  25. # Using own customized skeleton for the lexer code:
  26. # flex -S myflex.skl -o mylexer.c mylexer.l
  27. # Generate the myflex.skl from the development repo with:
  28. # sed 's/m4_/m4postproc_/g; s/m4preproc_/m4_/g' flex.skl | m4 -P -DFLEX_MAJOR_VERSION=2 -DFLEX_MINOR_VERSION=5 -DFLEX_SUBMINOR_VERSION=33 | sed 's/m4postproc_/m4_/g' > myflex.skl
  29. # Then edit the myflex.skl and test with needed fixes
  30. # sed 's/m4_/m4postproc_/g; s/m4preproc_/m4_/g' flex-2.4.6.skl | m4 -P -DFLEX_MAJOR_VERSION=2 -DFLEX_MINOR_VERSION=4 -DFLEX_SUBMINOR_VERSION=6 | sed 's/m4postproc_/m4_/g' > myflex.skl