[Flex-help] flex C++ parser is brittle in systems with more then one version of flex installed
flex is a tool for generating scanners
Brought to you by:
wlestes
|
From: John H. <jo...@gl...> - 2012-11-26 04:16:11
|
I am having a hard time using flex 2.5.37 installed at /usr/local on my OS X Mountain Lion system because flex 2.5.35 is already present under /usr. Getting XCode to use flex 2.5.37 is not too hard, but getting it to use /usr/local/include/FlexLexer.h is proving difficult. I would like a feature that would allow the lexer to include the correct version of FlexLexer.h. I propose that the option ‘--header-file=FILE, %option header-file="FILE"’ be allowed for C++ lexers. If the header option is present then flex copies FlexLexer.h to the specified file and includes that file in the lexer. You could even copy the correct lexer class name into the output instead of relying on a #define. I would be willing to work on a patch for this change if developers are interested. -- john |