0031740: Configuration - recover support of Yacc and Lex generation
authorabv <abv@opencascade.com>
Fri, 28 Aug 2020 15:09:54 +0000 (18:09 +0300)
committerbugmaster <bugmaster@opencascade.com>
Wed, 2 Sep 2020 16:25:24 +0000 (19:25 +0300)
commitfba34cf8ba9d7f50b935d160dedee50f9baaad65
treedfb9522cdbc5eb6d7180c465c2e058dd2a960768
parentdda9303c69c1a5280c1e8c9696767ba7bafd073f
0031740: Configuration - recover support of Yacc and Lex generation

Scripts adm/cmake/bison.cmake and adm/cmake/flex.cmake are refactored to enable actual search for bison and flex.
Apart of standard locations, also sub-folders of 3RDPARTY_DIR whose names contain "bison" and "flex", respectively, are added to search.
Cache variables 3RDPARTY_BISON_EXECUTABLE and 3RDPARTY_FLEX_EXECUTABLE are removed to avoid confusion (they duplicated similar variables without "3RDPARTY_" prefix).

Lex and Yacc files are corrected to match changes made manually in generated files during last years:
- StepFile/step.yacc: correction missing from #22972
- StepFile/step.lex: corrected for compilation (broken by #31060)
- MSVC-specific code is synchronized between StepFile/step.lex and ExprIntrp/ExprIntrp.lex
- Old commented code and duplicate code blocks removed

Commands for execution of Flex and Bison tools in CMake scripts are tweaked to avoid embedding line numbers (with local paths) in generated files.

Scanners and parsers are regenerated from updated source files with modified options.
Note that lex.ExprIntrp.c is regenerated with multiple differences because option -f (fast scanner) was used for generation of previous version (by WOK).
12 files changed:
adm/cmake/bison.cmake
adm/cmake/flex.cmake
adm/cmake/occt_toolkit.cmake
src/ExprIntrp/ExprIntrp.lex
src/ExprIntrp/ExprIntrp.tab.c
src/ExprIntrp/ExprIntrp.tab.h
src/ExprIntrp/lex.ExprIntrp.c
src/StepFile/lex.step.c
src/StepFile/step.lex
src/StepFile/step.tab.c
src/StepFile/step.tab.h
src/StepFile/step.yacc