[Flex-help] multiple scanners, one executable: sometimes it works
flex is a tool for generating scanners
Brought to you by:
wlestes
From: Randy S. <sm...@cs...> - 2007-10-01 20:51:36
|
Hello, I'm involved with a project in which there are two distinct scanners being placed in the same executable. To avoid naming collisions, etc, I'm using the -P option to rename the variables from yy* to something different. For both scanners, flex produces the C code without a problem. However, how well these interact depends on the version of flex being used. When using flex version 2.5.4 (run on a managed CentOS linux system), everything works as expected. Both scanners coexist peacefully. When using flex version 2.5.31 (run on a SuSE 10.1 linux system), I get multiply defined symbols when trying to compile the code: eidd_lex.o:(bss+0x2020): multiple definition of `yytext_ptr' xrta_lex.o:(bss+0x2020): first defined here So it seems the problem manifests with a later version of flex, whereas the early versions produced no conflicts. I hunted around a bit and saw some references to the fact that 'yytext_ptr' could be undef'd, but I couldn't find anything concrete. Is there a work-around to this problem? Can anybody shed some light on why I am experiencing this and what to do about it? thanks, Randy Smith |