[Flex-devel] Summary of new options I've added
flex is a tool for generating scanners
Brought to you by:
wlestes
From: Joe K. <kr...@ni...> - 2008-10-29 20:20:43
|
I added a special token to allow flex's internal scanner to support --options=OPTIONS, where OPTIONS is anything valid in %option. The modified scan.l also keeps boolean options separate, so that the "no" prefix is not silently accepted where it is invalid. I modified the full/fast options to only set the specific full/fast flags, which is in 3 places, because the command-line has individual flags and the grouped -C<opt> flag. I then modify useecs, usemecs, and use_read in check_options(), but only if the user didn't specify them. They are initially set to 'unspecified'. I added %options to exclude generating the remaining optional functions, but didn't make command-line versions. I added --include="PATH" to define the m4 include path to access skeleton files, and a matching one-letter option "-Y" which Sun's lex uses. Maybe the long option should be --skel-path=PATH. The main skeleton file is also expected to be there, but it checks the current directory first. The %option noline was missing, possibly removed because #line marks could be inserted before that option was read. I fixed this by modifying the linedir filter function to remove any #lines when noline is active, and added noline back to scan.l. I modified the prefix option to remove leading underscores if the prefix is blank. I added a yynamespace option for compiling the C scanner as C++, which can be used with a blank prefix, giving yy::lex() as the lexer function, for example. |