[Flex-devel] Suggestions for improvement
flex is a tool for generating scanners
Brought to you by:
wlestes
From: Joe K. <kr...@ni...> - 2008-09-25 23:22:37
|
I am using Bison's new C++ features with Flex. I did not use the new Flex C++ features, because they seem rather incomplete. Instead, I used Flex reentrant mode. In the process, I have a few suggestions. Given the recent update, I assume there is some active work in this area. The Flex reentrant version actually works quite well with Bison's C++ mode. it just requires a few tricks because Bison has a fixed definition for yylex(). I could put together an example, unless Bison C++ users would rather have a more complete Flex C++ scanner. OTOH, the flex source says "... or omit the C++ scanner altogether.", so maybe a good use of reentrant mode is a better goal? The one problem I had from Flex is that I am generating the output header file, which I also include indirectly in my flex source, causing several conflicts. When the header is generated, I think it would be better not to duplicate everything in the generated source as well, but put an include statement in the generated source, perhaps with a #define so the header can distinguish external and internal #includes. Some of the skeleton-file development would be more efficient by using external skeleton source files, as Bison does. Joe Krahn |