1*357f1050SThomas VeermanChanges between release 2.5.4 (11Sep96) and release 2.5.3: 2*357f1050SThomas Veerman 3*357f1050SThomas Veerman - Fixed a bug introduced in 2.5.3 that blew it when a call 4*357f1050SThomas Veerman to input() occurred at the end of an input file. 5*357f1050SThomas Veerman 6*357f1050SThomas Veerman - Fixed scanner skeleton so the example in the man page of 7*357f1050SThomas Veerman scanning strings using exclusive start conditions works. 8*357f1050SThomas Veerman 9*357f1050SThomas Veerman - Minor Makefile tweaks. 10*357f1050SThomas Veerman 11*357f1050SThomas Veerman 12*357f1050SThomas VeermanChanges between release 2.5.3 (29May96) and release 2.5.2: 13*357f1050SThomas Veerman 14*357f1050SThomas Veerman - Some serious bugs in yymore() have been fixed. In particular, 15*357f1050SThomas Veerman when using AT&T-lex-compatibility or %array, you can intermix 16*357f1050SThomas Veerman calls to input(), unput(), and yymore(). (This still doesn't 17*357f1050SThomas Veerman work for %pointer, and isn't likely to in the future.) 18*357f1050SThomas Veerman 19*357f1050SThomas Veerman - A bug in handling NUL's in the input stream of scanners using 20*357f1050SThomas Veerman REJECT has been fixed. 21*357f1050SThomas Veerman 22*357f1050SThomas Veerman - The default main() in libfl.a now repeatedly calls yylex() until 23*357f1050SThomas Veerman it returns 0, rather than just calling it once. 24*357f1050SThomas Veerman 25*357f1050SThomas Veerman - Minor tweak for Windows NT Makefile, MISC/NT/Makefile. 26*357f1050SThomas Veerman 27*357f1050SThomas Veerman 28*357f1050SThomas VeermanChanges between release 2.5.2 (25Apr95) and release 2.5.1: 29*357f1050SThomas Veerman 30*357f1050SThomas Veerman - The --prefix configuration option now works. 31*357f1050SThomas Veerman 32*357f1050SThomas Veerman - A bug that completely broke the "-Cf" table compression 33*357f1050SThomas Veerman option has been fixed. 34*357f1050SThomas Veerman 35*357f1050SThomas Veerman - A major headache involving "const" declarators and Solaris 36*357f1050SThomas Veerman systems has been fixed. 37*357f1050SThomas Veerman 38*357f1050SThomas Veerman - An octal escape sequence in a flex regular expression must 39*357f1050SThomas Veerman now contain only the digits 0-7. 40*357f1050SThomas Veerman 41*357f1050SThomas Veerman - You can now use "--" on the flex command line to mark the 42*357f1050SThomas Veerman end of flex options. 43*357f1050SThomas Veerman 44*357f1050SThomas Veerman - You can now specify the filename '-' as a synonym for stdin. 45*357f1050SThomas Veerman 46*357f1050SThomas Veerman - By default, the scanners generated by flex no longer 47*357f1050SThomas Veerman statically initialize yyin and yyout to stdin and stdout. 48*357f1050SThomas Veerman This change is necessary because in some ANSI environments, 49*357f1050SThomas Veerman stdin and stdout are not compile-time constant. You can 50*357f1050SThomas Veerman force the initialization using "%option stdinit" in the first 51*357f1050SThomas Veerman section of your flex input. 52*357f1050SThomas Veerman 53*357f1050SThomas Veerman - "%option nounput" now correctly omits the unput() routine 54*357f1050SThomas Veerman from the output. 55*357f1050SThomas Veerman 56*357f1050SThomas Veerman - "make clean" now removes config.log, config.cache, and the 57*357f1050SThomas Veerman flex binary. The fact that it removes the flex binary means 58*357f1050SThomas Veerman you should take care if making changes to scan.l, to make 59*357f1050SThomas Veerman sure you don't wind up in a bootstrap problem. 60*357f1050SThomas Veerman 61*357f1050SThomas Veerman - In general, the Makefile has been reworked somewhat (thanks 62*357f1050SThomas Veerman to Francois Pinard) for added flexibility - more changes will 63*357f1050SThomas Veerman follow in subsequent releases. 64*357f1050SThomas Veerman 65*357f1050SThomas Veerman - The .texi and .info files in MISC/texinfo/ have been updated, 66*357f1050SThomas Veerman thanks also to Francois Pinard. 67*357f1050SThomas Veerman 68*357f1050SThomas Veerman - The FlexLexer::yylex(istream* new_in, ostream* new_out) method 69*357f1050SThomas Veerman now does not have a default for the first argument, to disambiguate 70*357f1050SThomas Veerman it from FlexLexer::yylex(). 71*357f1050SThomas Veerman 72*357f1050SThomas Veerman - A bug in destructing a FlexLexer object before doing any scanning 73*357f1050SThomas Veerman with it has been fixed. 74*357f1050SThomas Veerman 75*357f1050SThomas Veerman - A problem with including FlexLexer.h multiple times has been fixed. 76*357f1050SThomas Veerman 77*357f1050SThomas Veerman - The alloca() chud necessary to accommodate bison has grown 78*357f1050SThomas Veerman even uglier, but hopefully more correct. 79*357f1050SThomas Veerman 80*357f1050SThomas Veerman - A portability tweak has been added to accommodate compilers that 81*357f1050SThomas Veerman use char* generic pointers. 82*357f1050SThomas Veerman 83*357f1050SThomas Veerman - EBCDIC contact information in the file MISC/EBCDIC has been updated. 84*357f1050SThomas Veerman 85*357f1050SThomas Veerman - An OS/2 Makefile and config.h for flex 2.5 is now available in 86*357f1050SThomas Veerman MISC/OS2/, contributed by Kai Uwe Rommel. 87*357f1050SThomas Veerman 88*357f1050SThomas Veerman - The descrip.mms file for building flex under VMS has been updated, 89*357f1050SThomas Veerman thanks to Pat Rankin. 90*357f1050SThomas Veerman 91*357f1050SThomas Veerman - The notes on building flex for the Amiga have been updated for 92*357f1050SThomas Veerman flex 2.5, contributed by Andreas Scherer. 93*357f1050SThomas Veerman 94*357f1050SThomas Veerman 95*357f1050SThomas VeermanChanges between release 2.5.1 (28Mar95) and release 2.4.7: 96*357f1050SThomas Veerman 97*357f1050SThomas Veerman - A new concept of "start condition" scope has been introduced. 98*357f1050SThomas Veerman A start condition scope is begun with: 99*357f1050SThomas Veerman 100*357f1050SThomas Veerman <SCs>{ 101*357f1050SThomas Veerman 102*357f1050SThomas Veerman where SCs is a list of one or more start conditions. Inside 103*357f1050SThomas Veerman the start condition scope, every rule automatically has the 104*357f1050SThomas Veerman prefix <SCs> applied to it, until a '}' which matches the 105*357f1050SThomas Veerman initial '{'. So, for example: 106*357f1050SThomas Veerman 107*357f1050SThomas Veerman <ESC>{ 108*357f1050SThomas Veerman "\\n" return '\n'; 109*357f1050SThomas Veerman "\\r" return '\r'; 110*357f1050SThomas Veerman "\\f" return '\f'; 111*357f1050SThomas Veerman "\\0" return '\0'; 112*357f1050SThomas Veerman } 113*357f1050SThomas Veerman 114*357f1050SThomas Veerman is equivalent to: 115*357f1050SThomas Veerman 116*357f1050SThomas Veerman <ESC>"\\n" return '\n'; 117*357f1050SThomas Veerman <ESC>"\\r" return '\r'; 118*357f1050SThomas Veerman <ESC>"\\f" return '\f'; 119*357f1050SThomas Veerman <ESC>"\\0" return '\0'; 120*357f1050SThomas Veerman 121*357f1050SThomas Veerman As indicated in this example, rules inside start condition scopes 122*357f1050SThomas Veerman (and any rule, actually, other than the first) can be indented, 123*357f1050SThomas Veerman to better show the extent of the scope. 124*357f1050SThomas Veerman 125*357f1050SThomas Veerman Start condition scopes may be nested. 126*357f1050SThomas Veerman 127*357f1050SThomas Veerman - The new %option directive can be used in the first section of 128*357f1050SThomas Veerman a flex scanner to control scanner-generation options. Most 129*357f1050SThomas Veerman options are given simply as names, optionally preceded by the 130*357f1050SThomas Veerman word "no" (with no intervening whitespace) to negate their 131*357f1050SThomas Veerman meaning. Some are equivalent to flex flags, so putting them 132*357f1050SThomas Veerman in your scanner source is equivalent to always specifying 133*357f1050SThomas Veerman the flag (%option's take precedence over flags): 134*357f1050SThomas Veerman 135*357f1050SThomas Veerman 7bit -7 option 136*357f1050SThomas Veerman 8bit -8 option 137*357f1050SThomas Veerman align -Ca option 138*357f1050SThomas Veerman backup -b option 139*357f1050SThomas Veerman batch -B option 140*357f1050SThomas Veerman c++ -+ option 141*357f1050SThomas Veerman caseful opposite of -i option (caseful is the default); 142*357f1050SThomas Veerman case-sensitive same as above 143*357f1050SThomas Veerman caseless -i option; 144*357f1050SThomas Veerman case-insensitive same as above 145*357f1050SThomas Veerman debug -d option 146*357f1050SThomas Veerman default opposite of -s option 147*357f1050SThomas Veerman ecs -Ce option 148*357f1050SThomas Veerman fast -F option 149*357f1050SThomas Veerman full -f option 150*357f1050SThomas Veerman interactive -I option 151*357f1050SThomas Veerman lex-compat -l option 152*357f1050SThomas Veerman meta-ecs -Cm option 153*357f1050SThomas Veerman perf-report -p option 154*357f1050SThomas Veerman read -Cr option 155*357f1050SThomas Veerman stdout -t option 156*357f1050SThomas Veerman verbose -v option 157*357f1050SThomas Veerman warn opposite of -w option (so use "%option nowarn" for -w) 158*357f1050SThomas Veerman 159*357f1050SThomas Veerman array equivalent to "%array" 160*357f1050SThomas Veerman pointer equivalent to "%pointer" (default) 161*357f1050SThomas Veerman 162*357f1050SThomas Veerman Some provide new features: 163*357f1050SThomas Veerman 164*357f1050SThomas Veerman always-interactive generate a scanner which always 165*357f1050SThomas Veerman considers its input "interactive" (no call to isatty() 166*357f1050SThomas Veerman will be made when the scanner runs) 167*357f1050SThomas Veerman main supply a main program for the scanner, which 168*357f1050SThomas Veerman simply calls yylex(). Implies %option noyywrap. 169*357f1050SThomas Veerman never-interactive generate a scanner which never 170*357f1050SThomas Veerman considers its input "interactive" (no call to isatty() 171*357f1050SThomas Veerman will be made when the scanner runs) 172*357f1050SThomas Veerman stack if set, enable start condition stacks (see below) 173*357f1050SThomas Veerman stdinit if unset ("%option nostdinit"), initialize yyin 174*357f1050SThomas Veerman and yyout statically to nil FILE* pointers, instead 175*357f1050SThomas Veerman of stdin and stdout 176*357f1050SThomas Veerman yylineno if set, keep track of the current line 177*357f1050SThomas Veerman number in global yylineno (this option is expensive 178*357f1050SThomas Veerman in terms of performance). The line number is available 179*357f1050SThomas Veerman to C++ scanning objects via the new member function 180*357f1050SThomas Veerman lineno(). 181*357f1050SThomas Veerman yywrap if unset ("%option noyywrap"), scanner does not 182*357f1050SThomas Veerman call yywrap() upon EOF but simply assumes there 183*357f1050SThomas Veerman are no more files to scan 184*357f1050SThomas Veerman 185*357f1050SThomas Veerman Flex scans your rule actions to determine whether you use the 186*357f1050SThomas Veerman REJECT or yymore features (this is not new). Two %options can be 187*357f1050SThomas Veerman used to override its decision, either by setting them to indicate 188*357f1050SThomas Veerman the feature is indeed used, or unsetting them to indicate it 189*357f1050SThomas Veerman actually is not used: 190*357f1050SThomas Veerman 191*357f1050SThomas Veerman reject 192*357f1050SThomas Veerman yymore 193*357f1050SThomas Veerman 194*357f1050SThomas Veerman Three %option's take string-delimited values, offset with '=': 195*357f1050SThomas Veerman 196*357f1050SThomas Veerman outfile="<name>" equivalent to -o<name> 197*357f1050SThomas Veerman prefix="<name>" equivalent to -P<name> 198*357f1050SThomas Veerman yyclass="<name>" set the name of the C++ scanning class 199*357f1050SThomas Veerman (see below) 200*357f1050SThomas Veerman 201*357f1050SThomas Veerman A number of %option's are available for lint purists who 202*357f1050SThomas Veerman want to suppress the appearance of unneeded routines in 203*357f1050SThomas Veerman the generated scanner. Each of the following, if unset, 204*357f1050SThomas Veerman results in the corresponding routine not appearing in the 205*357f1050SThomas Veerman generated scanner: 206*357f1050SThomas Veerman 207*357f1050SThomas Veerman input, unput 208*357f1050SThomas Veerman yy_push_state, yy_pop_state, yy_top_state 209*357f1050SThomas Veerman yy_scan_buffer, yy_scan_bytes, yy_scan_string 210*357f1050SThomas Veerman 211*357f1050SThomas Veerman You can specify multiple options with a single %option directive, 212*357f1050SThomas Veerman and multiple directives in the first section of your flex input file. 213*357f1050SThomas Veerman 214*357f1050SThomas Veerman - The new function: 215*357f1050SThomas Veerman 216*357f1050SThomas Veerman YY_BUFFER_STATE yy_scan_string( const char *str ) 217*357f1050SThomas Veerman 218*357f1050SThomas Veerman returns a YY_BUFFER_STATE (which also becomes the current input 219*357f1050SThomas Veerman buffer) for scanning the given string, which occurs starting 220*357f1050SThomas Veerman with the next call to yylex(). The string must be NUL-terminated. 221*357f1050SThomas Veerman A related function: 222*357f1050SThomas Veerman 223*357f1050SThomas Veerman YY_BUFFER_STATE yy_scan_bytes( const char *bytes, int len ) 224*357f1050SThomas Veerman 225*357f1050SThomas Veerman creates a buffer for scanning "len" bytes (including possibly NUL's) 226*357f1050SThomas Veerman starting at location "bytes". 227*357f1050SThomas Veerman 228*357f1050SThomas Veerman Note that both of these functions create and scan a *copy* of 229*357f1050SThomas Veerman the string/bytes. (This may be desirable, since yylex() modifies 230*357f1050SThomas Veerman the contents of the buffer it is scanning.) You can avoid the 231*357f1050SThomas Veerman copy by using: 232*357f1050SThomas Veerman 233*357f1050SThomas Veerman YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) 234*357f1050SThomas Veerman 235*357f1050SThomas Veerman which scans in place the buffer starting at "base", consisting 236*357f1050SThomas Veerman of "size" bytes, the last two bytes of which *must* be 237*357f1050SThomas Veerman YY_END_OF_BUFFER_CHAR (these bytes are not scanned; thus, scanning 238*357f1050SThomas Veerman consists of base[0] through base[size-2], inclusive). If you 239*357f1050SThomas Veerman fail to set up "base" in this manner, yy_scan_buffer returns a 240*357f1050SThomas Veerman nil pointer instead of creating a new input buffer. 241*357f1050SThomas Veerman 242*357f1050SThomas Veerman The type yy_size_t is an integral type to which you can cast 243*357f1050SThomas Veerman an integer expression reflecting the size of the buffer. 244*357f1050SThomas Veerman 245*357f1050SThomas Veerman - Three new routines are available for manipulating stacks of 246*357f1050SThomas Veerman start conditions: 247*357f1050SThomas Veerman 248*357f1050SThomas Veerman void yy_push_state( int new_state ) 249*357f1050SThomas Veerman 250*357f1050SThomas Veerman pushes the current start condition onto the top of the stack 251*357f1050SThomas Veerman and BEGIN's "new_state" (recall that start condition names are 252*357f1050SThomas Veerman also integers). 253*357f1050SThomas Veerman 254*357f1050SThomas Veerman void yy_pop_state() 255*357f1050SThomas Veerman 256*357f1050SThomas Veerman pops the top of the stack and BEGIN's to it, and 257*357f1050SThomas Veerman 258*357f1050SThomas Veerman int yy_top_state() 259*357f1050SThomas Veerman 260*357f1050SThomas Veerman returns the top of the stack without altering the stack's 261*357f1050SThomas Veerman contents. 262*357f1050SThomas Veerman 263*357f1050SThomas Veerman The start condition stack grows dynamically and so has no built-in 264*357f1050SThomas Veerman size limitation. If memory is exhausted, program execution 265*357f1050SThomas Veerman is aborted. 266*357f1050SThomas Veerman 267*357f1050SThomas Veerman To use start condition stacks, your scanner must include 268*357f1050SThomas Veerman a "%option stack" directive. 269*357f1050SThomas Veerman 270*357f1050SThomas Veerman - flex now supports POSIX character class expressions. These 271*357f1050SThomas Veerman are expressions enclosed inside "[:" and ":]" delimiters (which 272*357f1050SThomas Veerman themselves must appear between the '[' and ']' of a character 273*357f1050SThomas Veerman class; other elements may occur inside the character class, too). 274*357f1050SThomas Veerman The expressions flex recognizes are: 275*357f1050SThomas Veerman 276*357f1050SThomas Veerman [:alnum:] [:alpha:] [:blank:] [:cntrl:] [:digit:] [:graph:] 277*357f1050SThomas Veerman [:lower:] [:print:] [:punct:] [:space:] [:upper:] [:xdigit:] 278*357f1050SThomas Veerman 279*357f1050SThomas Veerman These expressions all designate a set of characters equivalent to 280*357f1050SThomas Veerman the corresponding isXXX function (for example, [:alnum:] designates 281*357f1050SThomas Veerman those characters for which isalnum() returns true - i.e., any 282*357f1050SThomas Veerman alphabetic or numeric). Some systems don't provide isblank(), 283*357f1050SThomas Veerman so flex defines [:blank:] as a blank or a tab. 284*357f1050SThomas Veerman 285*357f1050SThomas Veerman For example, the following character classes are all equivalent: 286*357f1050SThomas Veerman 287*357f1050SThomas Veerman [[:alnum:]] 288*357f1050SThomas Veerman [[:alpha:][:digit:] 289*357f1050SThomas Veerman [[:alpha:]0-9] 290*357f1050SThomas Veerman [a-zA-Z0-9] 291*357f1050SThomas Veerman 292*357f1050SThomas Veerman If your scanner is case-insensitive (-i flag), then [:upper:] 293*357f1050SThomas Veerman and [:lower:] are equivalent to [:alpha:]. 294*357f1050SThomas Veerman 295*357f1050SThomas Veerman - The promised rewrite of the C++ FlexLexer class has not yet 296*357f1050SThomas Veerman been done. Support for FlexLexer is limited at the moment to 297*357f1050SThomas Veerman fixing show-stopper bugs, so, for example, the new functions 298*357f1050SThomas Veerman yy_scan_string() & friends are not available to FlexLexer 299*357f1050SThomas Veerman objects. 300*357f1050SThomas Veerman 301*357f1050SThomas Veerman - The new macro 302*357f1050SThomas Veerman 303*357f1050SThomas Veerman yy_set_interactive(is_interactive) 304*357f1050SThomas Veerman 305*357f1050SThomas Veerman can be used to control whether the current buffer is considered 306*357f1050SThomas Veerman "interactive". An interactive buffer is processed more slowly, 307*357f1050SThomas Veerman but must be used when the scanner's input source is indeed 308*357f1050SThomas Veerman interactive to avoid problems due to waiting to fill buffers 309*357f1050SThomas Veerman (see the discussion of the -I flag in flex.1). A non-zero value 310*357f1050SThomas Veerman in the macro invocation marks the buffer as interactive, a zero 311*357f1050SThomas Veerman value as non-interactive. Note that use of this macro overrides 312*357f1050SThomas Veerman "%option always-interactive" or "%option never-interactive". 313*357f1050SThomas Veerman 314*357f1050SThomas Veerman yy_set_interactive() must be invoked prior to beginning to 315*357f1050SThomas Veerman scan the buffer. 316*357f1050SThomas Veerman 317*357f1050SThomas Veerman - The new macro 318*357f1050SThomas Veerman 319*357f1050SThomas Veerman yy_set_bol(at_bol) 320*357f1050SThomas Veerman 321*357f1050SThomas Veerman can be used to control whether the current buffer's scanning 322*357f1050SThomas Veerman context for the next token match is done as though at the 323*357f1050SThomas Veerman beginning of a line (non-zero macro argument; makes '^' anchored 324*357f1050SThomas Veerman rules active) or not at the beginning of a line (zero argument, 325*357f1050SThomas Veerman '^' rules inactive). 326*357f1050SThomas Veerman 327*357f1050SThomas Veerman - Related to this change, the mechanism for determining when a scan is 328*357f1050SThomas Veerman starting at the beginning of a line has changed. It used to be 329*357f1050SThomas Veerman that '^' was active iff the character prior to that at which the 330*357f1050SThomas Veerman scan started was a newline. The mechanism now is that '^' is 331*357f1050SThomas Veerman active iff the last token ended in a newline (or the last call to 332*357f1050SThomas Veerman input() returned a newline). For most users, the difference in 333*357f1050SThomas Veerman mechanisms is negligible. Where it will make a difference, 334*357f1050SThomas Veerman however, is if unput() or yyless() is used to alter the input 335*357f1050SThomas Veerman stream. When in doubt, use yy_set_bol(). 336*357f1050SThomas Veerman 337*357f1050SThomas Veerman - The new beginning-of-line mechanism involved changing some fairly 338*357f1050SThomas Veerman twisted code, so it may have introduced bugs - beware ... 339*357f1050SThomas Veerman 340*357f1050SThomas Veerman - The macro YY_AT_BOL() returns true if the next token scanned from 341*357f1050SThomas Veerman the current buffer will have '^' rules active, false otherwise. 342*357f1050SThomas Veerman 343*357f1050SThomas Veerman - The new function 344*357f1050SThomas Veerman 345*357f1050SThomas Veerman void yy_flush_buffer( struct yy_buffer_state* b ) 346*357f1050SThomas Veerman 347*357f1050SThomas Veerman flushes the contents of the current buffer (i.e., next time 348*357f1050SThomas Veerman the scanner attempts to match a token using b as the current 349*357f1050SThomas Veerman buffer, it will begin by invoking YY_INPUT to fill the buffer). 350*357f1050SThomas Veerman This routine is also available to C++ scanners (unlike some 351*357f1050SThomas Veerman of the other new routines). 352*357f1050SThomas Veerman 353*357f1050SThomas Veerman The related macro 354*357f1050SThomas Veerman 355*357f1050SThomas Veerman YY_FLUSH_BUFFER 356*357f1050SThomas Veerman 357*357f1050SThomas Veerman flushes the contents of the current buffer. 358*357f1050SThomas Veerman 359*357f1050SThomas Veerman - A new "-ooutput" option writes the generated scanner to "output". 360*357f1050SThomas Veerman If used with -t, the scanner is still written to stdout, but 361*357f1050SThomas Veerman its internal #line directives (see previous item) use "output". 362*357f1050SThomas Veerman 363*357f1050SThomas Veerman - Flex now generates #line directives relating the code it 364*357f1050SThomas Veerman produces to the output file; this means that error messages 365*357f1050SThomas Veerman in the flex-generated code should be correctly pinpointed. 366*357f1050SThomas Veerman 367*357f1050SThomas Veerman - When generating #line directives, filenames with embedded '\'s 368*357f1050SThomas Veerman have those characters escaped (i.e., turned into '\\'). This 369*357f1050SThomas Veerman feature helps with reporting filenames for some MS-DOS and OS/2 370*357f1050SThomas Veerman systems. 371*357f1050SThomas Veerman 372*357f1050SThomas Veerman - The FlexLexer class includes two new public member functions: 373*357f1050SThomas Veerman 374*357f1050SThomas Veerman virtual void switch_streams( istream* new_in = 0, 375*357f1050SThomas Veerman ostream* new_out = 0 ) 376*357f1050SThomas Veerman 377*357f1050SThomas Veerman reassigns yyin to new_in (if non-nil) and yyout to new_out 378*357f1050SThomas Veerman (ditto), deleting the previous input buffer if yyin is 379*357f1050SThomas Veerman reassigned. It is used by: 380*357f1050SThomas Veerman 381*357f1050SThomas Veerman int yylex( istream* new_in = 0, ostream* new_out = 0 ) 382*357f1050SThomas Veerman 383*357f1050SThomas Veerman which first calls switch_streams() and then returns the value 384*357f1050SThomas Veerman of calling yylex(). 385*357f1050SThomas Veerman 386*357f1050SThomas Veerman - C++ scanners now have yy_flex_debug as a member variable of 387*357f1050SThomas Veerman FlexLexer rather than a global, and member functions for testing 388*357f1050SThomas Veerman and setting it. 389*357f1050SThomas Veerman 390*357f1050SThomas Veerman - When generating a C++ scanning class, you can now use 391*357f1050SThomas Veerman 392*357f1050SThomas Veerman %option yyclass="foo" 393*357f1050SThomas Veerman 394*357f1050SThomas Veerman to inform flex that you have derived "foo" as a subclass of 395*357f1050SThomas Veerman yyFlexLexer, so flex will place your actions in the member 396*357f1050SThomas Veerman function foo::yylex() instead of yyFlexLexer::yylex(). It also 397*357f1050SThomas Veerman generates a yyFlexLexer::yylex() member function that generates a 398*357f1050SThomas Veerman run-time error if called (by invoking yyFlexLexer::LexerError()). 399*357f1050SThomas Veerman This feature is necessary if your subclass "foo" introduces some 400*357f1050SThomas Veerman additional member functions or variables that you need to access 401*357f1050SThomas Veerman from yylex(). 402*357f1050SThomas Veerman 403*357f1050SThomas Veerman - Current texinfo files in MISC/texinfo, contributed by Francois 404*357f1050SThomas Veerman Pinard. 405*357f1050SThomas Veerman 406*357f1050SThomas Veerman - You can now change the name "flex" to something else (e.g., "lex") 407*357f1050SThomas Veerman by redefining $(FLEX) in the Makefile. 408*357f1050SThomas Veerman 409*357f1050SThomas Veerman - Two bugs (one serious) that could cause "bigcheck" to fail have 410*357f1050SThomas Veerman been fixed. 411*357f1050SThomas Veerman 412*357f1050SThomas Veerman - A number of portability/configuration changes have been made 413*357f1050SThomas Veerman for easier portability. 414*357f1050SThomas Veerman 415*357f1050SThomas Veerman - You can use "YYSTATE" in your scanner as an alias for YY_START 416*357f1050SThomas Veerman (for AT&T lex compatibility). 417*357f1050SThomas Veerman 418*357f1050SThomas Veerman - input() now maintains yylineno. 419*357f1050SThomas Veerman 420*357f1050SThomas Veerman - input() no longer trashes yytext. 421*357f1050SThomas Veerman 422*357f1050SThomas Veerman - interactive scanners now read characters in YY_INPUT up to a 423*357f1050SThomas Veerman newline, a large performance gain. 424*357f1050SThomas Veerman 425*357f1050SThomas Veerman - C++ scanner objects now work with the -P option. You include 426*357f1050SThomas Veerman <FlexLexer.h> once per scanner - see comments in <FlexLexer.h> 427*357f1050SThomas Veerman (or flex.1) for details. 428*357f1050SThomas Veerman 429*357f1050SThomas Veerman - C++ FlexLexer objects now use the "cerr" stream to report -d output 430*357f1050SThomas Veerman instead of stdio. 431*357f1050SThomas Veerman 432*357f1050SThomas Veerman - The -c flag now has its full glorious POSIX interpretation (do 433*357f1050SThomas Veerman nothing), rather than being interpreted as an old-style -C flag. 434*357f1050SThomas Veerman 435*357f1050SThomas Veerman - Scanners generated by flex now include two #define's giving 436*357f1050SThomas Veerman the major and minor version numbers (YY_FLEX_MAJOR_VERSION, 437*357f1050SThomas Veerman YY_FLEX_MINOR_VERSION). These can then be tested to see 438*357f1050SThomas Veerman whether certain flex features are available. 439*357f1050SThomas Veerman 440*357f1050SThomas Veerman - Scanners generated using -l lex compatibility now have the symbol 441*357f1050SThomas Veerman YY_FLEX_LEX_COMPAT #define'd. 442*357f1050SThomas Veerman 443*357f1050SThomas Veerman - When initializing (i.e., yy_init is non-zero on entry to yylex()), 444*357f1050SThomas Veerman generated scanners now set yy_init to zero before executing 445*357f1050SThomas Veerman YY_USER_INIT. This means that you can set yy_init back to a 446*357f1050SThomas Veerman non-zero value in YY_USER_INIT if you need the scanner to be 447*357f1050SThomas Veerman reinitialized on the next call. 448*357f1050SThomas Veerman 449*357f1050SThomas Veerman - You can now use "#line" directives in the first section of your 450*357f1050SThomas Veerman scanner specification. 451*357f1050SThomas Veerman 452*357f1050SThomas Veerman - When generating full-table scanners (-Cf), flex now puts braces 453*357f1050SThomas Veerman around each row of the 2-d array initialization, to silence warnings 454*357f1050SThomas Veerman on over-zealous compilers. 455*357f1050SThomas Veerman 456*357f1050SThomas Veerman - Improved support for MS-DOS. The flex sources have been successfully 457*357f1050SThomas Veerman built, unmodified, for Borland 4.02 (all that's required is a 458*357f1050SThomas Veerman Borland Makefile and config.h file, which are supplied in 459*357f1050SThomas Veerman MISC/Borland - contributed by Terrence O Kane). 460*357f1050SThomas Veerman 461*357f1050SThomas Veerman - Improved support for Macintosh using Think C - the sources should 462*357f1050SThomas Veerman build for this platform "out of the box". Contributed by Scott 463*357f1050SThomas Veerman Hofmann. 464*357f1050SThomas Veerman 465*357f1050SThomas Veerman - Improved support for VMS, in MISC/VMS/, contributed by Pat Rankin. 466*357f1050SThomas Veerman 467*357f1050SThomas Veerman - Support for the Amiga, in MISC/Amiga/, contributed by Andreas 468*357f1050SThomas Veerman Scherer. Note that the contributed files were developed for 469*357f1050SThomas Veerman flex 2.4 and have not been tested with flex 2.5. 470*357f1050SThomas Veerman 471*357f1050SThomas Veerman - Some notes on support for the NeXT, in MISC/NeXT, contributed 472*357f1050SThomas Veerman by Raf Schietekat. 473*357f1050SThomas Veerman 474*357f1050SThomas Veerman - The MISC/ directory now includes a preformatted version of flex.1 475*357f1050SThomas Veerman in flex.man, and pre-yacc'd versions of parse.y in parse.{c,h}. 476*357f1050SThomas Veerman 477*357f1050SThomas Veerman - The flex.1 and flexdoc.1 manual pages have been merged. There 478*357f1050SThomas Veerman is now just one document, flex.1, which includes an overview 479*357f1050SThomas Veerman at the beginning to help you find the section you need. 480*357f1050SThomas Veerman 481*357f1050SThomas Veerman - Documentation now clarifies that start conditions persist across 482*357f1050SThomas Veerman switches to new input files or different input buffers. If you 483*357f1050SThomas Veerman want to e.g., return to INITIAL, you must explicitly do so. 484*357f1050SThomas Veerman 485*357f1050SThomas Veerman - The "Performance Considerations" section of the manual has been 486*357f1050SThomas Veerman updated. 487*357f1050SThomas Veerman 488*357f1050SThomas Veerman - Documented the "yy_act" variable, which when YY_USER_ACTION is 489*357f1050SThomas Veerman invoked holds the number of the matched rule, and added an 490*357f1050SThomas Veerman example of using yy_act to profile how often each rule is matched. 491*357f1050SThomas Veerman 492*357f1050SThomas Veerman - Added YY_NUM_RULES, a definition that gives the total number 493*357f1050SThomas Veerman of rules in the file, including the default rule (even if you 494*357f1050SThomas Veerman use -s). 495*357f1050SThomas Veerman 496*357f1050SThomas Veerman - Documentation now clarifies that you can pass a nil FILE* pointer 497*357f1050SThomas Veerman to yy_create_buffer() or yyrestart() if you've arrange YY_INPUT 498*357f1050SThomas Veerman to not need yyin. 499*357f1050SThomas Veerman 500*357f1050SThomas Veerman - Documentation now clarifies that YY_BUFFER_STATE is a pointer to 501*357f1050SThomas Veerman an opaque "struct yy_buffer_state". 502*357f1050SThomas Veerman 503*357f1050SThomas Veerman - Documentation now stresses that you gain the benefits of removing 504*357f1050SThomas Veerman backing-up states only if you remove *all* of them. 505*357f1050SThomas Veerman 506*357f1050SThomas Veerman - Documentation now points out that traditional lex allows you 507*357f1050SThomas Veerman to put the action on a separate line from the rule pattern if 508*357f1050SThomas Veerman the pattern has trailing whitespace (ugh!), but flex doesn't 509*357f1050SThomas Veerman support this. 510*357f1050SThomas Veerman 511*357f1050SThomas Veerman - A broken example in documentation of the difference between 512*357f1050SThomas Veerman inclusive and exclusive start conditions is now fixed. 513*357f1050SThomas Veerman 514*357f1050SThomas Veerman - Usage (-h) report now goes to stdout. 515*357f1050SThomas Veerman 516*357f1050SThomas Veerman - Version (-V) info now goes to stdout. 517*357f1050SThomas Veerman 518*357f1050SThomas Veerman - More #ifdef chud has been added to the parser in attempt to 519*357f1050SThomas Veerman deal with bison's use of alloca(). 520*357f1050SThomas Veerman 521*357f1050SThomas Veerman - "make clean" no longer deletes emacs backup files (*~). 522*357f1050SThomas Veerman 523*357f1050SThomas Veerman - Some memory leaks have been fixed. 524*357f1050SThomas Veerman 525*357f1050SThomas Veerman - A bug was fixed in which dynamically-expanded buffers were 526*357f1050SThomas Veerman reallocated a couple of bytes too small. 527*357f1050SThomas Veerman 528*357f1050SThomas Veerman - A bug was fixed which could cause flex to read and write beyond 529*357f1050SThomas Veerman the end of the input buffer. 530*357f1050SThomas Veerman 531*357f1050SThomas Veerman - -S will not be going away. 532*357f1050SThomas Veerman 533*357f1050SThomas Veerman 534*357f1050SThomas VeermanChanges between release 2.4.7 (03Aug94) and release 2.4.6: 535*357f1050SThomas Veerman 536*357f1050SThomas Veerman - Fixed serious bug in reading multiple files. 537*357f1050SThomas Veerman 538*357f1050SThomas Veerman - Fixed bug in scanning NUL's. 539*357f1050SThomas Veerman 540*357f1050SThomas Veerman - Fixed bug in input() returning 8-bit characters. 541*357f1050SThomas Veerman 542*357f1050SThomas Veerman - Fixed bug in matching text with embedded NUL's when 543*357f1050SThomas Veerman using %array or lex compatibility. 544*357f1050SThomas Veerman 545*357f1050SThomas Veerman - Fixed multiple invocations of YY_USER_ACTION when using '|' 546*357f1050SThomas Veerman continuation action. 547*357f1050SThomas Veerman 548*357f1050SThomas Veerman - Minor prototyping fixes. 549*357f1050SThomas Veerman 550*357f1050SThomas VeermanChanges between release 2.4.6 (04Jan94) and release 2.4.5: 551*357f1050SThomas Veerman 552*357f1050SThomas Veerman - Linking with -lfl no longer required if your program includes 553*357f1050SThomas Veerman its own yywrap() and main() functions. (This change will cause 554*357f1050SThomas Veerman problems if you have a non-ANSI compiler on a system for which 555*357f1050SThomas Veerman sizeof(int) != sizeof(void*) or sizeof(int) != sizeof(size_t).) 556*357f1050SThomas Veerman 557*357f1050SThomas Veerman - The use of 'extern "C++"' in FlexLexer.h has been modified to 558*357f1050SThomas Veerman get around an incompatibility with g++'s header files. 559*357f1050SThomas Veerman 560*357f1050SThomas VeermanChanges between release 2.4.5 (11Dec93) and release 2.4.4: 561*357f1050SThomas Veerman 562*357f1050SThomas Veerman - Fixed bug breaking C++ scanners that use REJECT or variable 563*357f1050SThomas Veerman trailing context. 564*357f1050SThomas Veerman 565*357f1050SThomas Veerman - Fixed serious input problem for interactive scanners on 566*357f1050SThomas Veerman systems for which char is unsigned. 567*357f1050SThomas Veerman 568*357f1050SThomas Veerman - Fixed bug in incorrectly treating '$' operator as variable 569*357f1050SThomas Veerman trailing context. 570*357f1050SThomas Veerman 571*357f1050SThomas Veerman - Fixed bug in -CF table representation that could lead to 572*357f1050SThomas Veerman corrupt tables. 573*357f1050SThomas Veerman 574*357f1050SThomas Veerman - Fixed fairly benign memory leak. 575*357f1050SThomas Veerman 576*357f1050SThomas Veerman - Added `extern "C++"' wrapper to FlexLexer.h header. This 577*357f1050SThomas Veerman should overcome the g++ 2.5.X problems mentioned in the 578*357f1050SThomas Veerman NEWS for release 2.4.3. 579*357f1050SThomas Veerman 580*357f1050SThomas Veerman - Changed #include of FlexLexer.h to use <> instead of "". 581*357f1050SThomas Veerman 582*357f1050SThomas Veerman - Added feature to control whether the scanner attempts to 583*357f1050SThomas Veerman refill the input buffer once it's exhausted. This feature 584*357f1050SThomas Veerman will be documented in the 2.5 release. 585*357f1050SThomas Veerman 586*357f1050SThomas Veerman 587*357f1050SThomas VeermanChanges between release 2.4.4 (07Dec93) and release 2.4.3: 588*357f1050SThomas Veerman 589*357f1050SThomas Veerman - Fixed two serious bugs in scanning 8-bit characters. 590*357f1050SThomas Veerman 591*357f1050SThomas Veerman - Fixed bug in YY_USER_ACTION that caused it to be executed 592*357f1050SThomas Veerman inappropriately (on the scanner's own internal actions, and 593*357f1050SThomas Veerman with incorrect yytext/yyleng values). 594*357f1050SThomas Veerman 595*357f1050SThomas Veerman - Fixed bug in pointing yyin at a new file and resuming scanning. 596*357f1050SThomas Veerman 597*357f1050SThomas Veerman - Portability fix regarding min/max/abs macros conflicting with 598*357f1050SThomas Veerman function definitions in standard header files. 599*357f1050SThomas Veerman 600*357f1050SThomas Veerman - Added a virtual LexerError() method to the C++ yyFlexLexer class 601*357f1050SThomas Veerman for reporting error messages instead of always using cerr. 602*357f1050SThomas Veerman 603*357f1050SThomas Veerman - Added warning in flexdoc that the C++ scanning class is presently 604*357f1050SThomas Veerman experimental and subject to considerable change between major 605*357f1050SThomas Veerman releases. 606*357f1050SThomas Veerman 607*357f1050SThomas Veerman 608*357f1050SThomas VeermanChanges between release 2.4.3 (03Dec93) and release 2.4.2: 609*357f1050SThomas Veerman 610*357f1050SThomas Veerman - Fixed bug causing fatal scanner messages to fail to print. 611*357f1050SThomas Veerman 612*357f1050SThomas Veerman - Fixed things so FlexLexer.h can be included in other C++ 613*357f1050SThomas Veerman sources. One side-effect of this change is that -+ and -CF 614*357f1050SThomas Veerman are now incompatible. 615*357f1050SThomas Veerman 616*357f1050SThomas Veerman - libfl.a now supplies private versions of the the <string.h>/ 617*357f1050SThomas Veerman <strings.h> string routines needed by flex and the scanners 618*357f1050SThomas Veerman it generates, to enhance portability to some BSD systems. 619*357f1050SThomas Veerman 620*357f1050SThomas Veerman - More robust solution to 2.4.2's flexfatal() bug fix. 621*357f1050SThomas Veerman 622*357f1050SThomas Veerman - Added ranlib of installed libfl.a. 623*357f1050SThomas Veerman 624*357f1050SThomas Veerman - Some lint tweaks. 625*357f1050SThomas Veerman 626*357f1050SThomas Veerman - NOTE: problems have been encountered attempting to build flex 627*357f1050SThomas Veerman C++ scanners using g++ version 2.5.X. The problem is due to an 628*357f1050SThomas Veerman unfortunate heuristic in g++ 2.5.X that attempts to discern between 629*357f1050SThomas Veerman C and C++ headers. Because FlexLexer.h is installed (by default) 630*357f1050SThomas Veerman in /usr/local/include and not /usr/local/lib/g++-include, g++ 2.5.X 631*357f1050SThomas Veerman decides that it's a C header :-(. So if you have problems, install 632*357f1050SThomas Veerman the header in /usr/local/lib/g++-include instead. 633*357f1050SThomas Veerman 634*357f1050SThomas Veerman 635*357f1050SThomas VeermanChanges between release 2.4.2 (01Dec93) and release 2.4.1: 636*357f1050SThomas Veerman 637*357f1050SThomas Veerman - Fixed bug in libfl.a referring to non-existent "flexfatal" function. 638*357f1050SThomas Veerman 639*357f1050SThomas Veerman - Modified to produce both compress'd and gzip'd tar files for 640*357f1050SThomas Veerman distributions (you probably don't care about this change!). 641*357f1050SThomas Veerman 642*357f1050SThomas Veerman 643*357f1050SThomas VeermanChanges between release 2.4.1 (30Nov93) and release 2.3.8: 644*357f1050SThomas Veerman 645*357f1050SThomas Veerman - The new '-+' flag instructs flex to generate a C++ scanner class 646*357f1050SThomas Veerman (thanks to Kent Williams). flex writes an implementation of the 647*357f1050SThomas Veerman class defined in FlexLexer.h to lex.yy.cc. You may include 648*357f1050SThomas Veerman multiple scanner classes in your program using the -P flag. Note 649*357f1050SThomas Veerman that the scanner class also provides a mechanism for creating 650*357f1050SThomas Veerman reentrant scanners. The scanner class uses C++ streams for I/O 651*357f1050SThomas Veerman instead of FILE*'s (thanks to Tom Epperly). If the flex executable's 652*357f1050SThomas Veerman name ends in '+' then the '-+' flag is automatically on, so creating 653*357f1050SThomas Veerman a symlink or copy of "flex" to "flex++" results in a version of 654*357f1050SThomas Veerman flex that can be used exclusively for C++ scanners. 655*357f1050SThomas Veerman 656*357f1050SThomas Veerman Note that without the '-+' flag, flex-generated scanners can still 657*357f1050SThomas Veerman be compiled using C++ compilers, though they use FILE*'s for I/O 658*357f1050SThomas Veerman instead of streams. 659*357f1050SThomas Veerman 660*357f1050SThomas Veerman See the "GENERATING C++ SCANNERS" section of flexdoc for details. 661*357f1050SThomas Veerman 662*357f1050SThomas Veerman - The new '-l' flag turns on maximum AT&T lex compatibility. In 663*357f1050SThomas Veerman particular, -l includes support for "yylineno" and makes yytext 664*357f1050SThomas Veerman be an array instead of a pointer. It does not, however, do away 665*357f1050SThomas Veerman with all incompatibilities. See the "INCOMPATIBILITIES WITH LEX 666*357f1050SThomas Veerman AND POSIX" section of flexdoc for details. 667*357f1050SThomas Veerman 668*357f1050SThomas Veerman - The new '-P' option specifies a prefix to use other than "yy" 669*357f1050SThomas Veerman for the scanner's globally-visible variables, and for the 670*357f1050SThomas Veerman "lex.yy.c" filename. Using -P you can link together multiple 671*357f1050SThomas Veerman flex scanners in the same executable. 672*357f1050SThomas Veerman 673*357f1050SThomas Veerman - The distribution includes a "texinfo" version of flexdoc.1, 674*357f1050SThomas Veerman contributed by Roland Pesch (thanks also to Marq Kole, who 675*357f1050SThomas Veerman contributed another version). It has not been brought up to 676*357f1050SThomas Veerman date, but reflects version 2.3. See MISC/flex.texinfo. 677*357f1050SThomas Veerman 678*357f1050SThomas Veerman The flex distribution will soon include G.T. Nicol's flex 679*357f1050SThomas Veerman manual; he is presently bringing it up-to-date for version 2.4. 680*357f1050SThomas Veerman 681*357f1050SThomas Veerman - yywrap() is now a function, and you now *must* link flex scanners 682*357f1050SThomas Veerman with libfl.a. 683*357f1050SThomas Veerman 684*357f1050SThomas Veerman - Site-configuration is now done via an autoconf-generated 685*357f1050SThomas Veerman "configure" script contributed by Francois Pinard. 686*357f1050SThomas Veerman 687*357f1050SThomas Veerman - Scanners now use fread() (or getc(), if interactive) and not 688*357f1050SThomas Veerman read() for input. A new "table compression" option, -Cr, 689*357f1050SThomas Veerman overrides this change and causes the scanner to use read() 690*357f1050SThomas Veerman (because read() is a bit faster than fread()). -f and -F 691*357f1050SThomas Veerman are now equivalent to -Cfr and -CFr; i.e., they imply the 692*357f1050SThomas Veerman -Cr option. 693*357f1050SThomas Veerman 694*357f1050SThomas Veerman - In the blessed name of POSIX compliance, flex supports "%array" 695*357f1050SThomas Veerman and "%pointer" directives in the definitions (first) section of 696*357f1050SThomas Veerman the scanner specification. The former specifies that yytext 697*357f1050SThomas Veerman should be an array (of size YYLMAX), the latter, that it should 698*357f1050SThomas Veerman be a pointer. The array version of yytext is universally slower 699*357f1050SThomas Veerman than the pointer version, but has the advantage that its contents 700*357f1050SThomas Veerman remain unmodified across calls to input() and unput() (the pointer 701*357f1050SThomas Veerman version of yytext is, still, trashed by such calls). 702*357f1050SThomas Veerman 703*357f1050SThomas Veerman "%array" cannot be used with the '-+' C++ scanner class option. 704*357f1050SThomas Veerman 705*357f1050SThomas Veerman - The new '-Ca' option directs flex to trade off memory for 706*357f1050SThomas Veerman natural alignment when generating a scanner's tables. In 707*357f1050SThomas Veerman particular, table entries that would otherwise be "short" 708*357f1050SThomas Veerman become "long". 709*357f1050SThomas Veerman 710*357f1050SThomas Veerman - The new '-h' option produces a summary of the flex flags. 711*357f1050SThomas Veerman 712*357f1050SThomas Veerman - The new '-V' option reports the flex version number and exits. 713*357f1050SThomas Veerman 714*357f1050SThomas Veerman - The new scanner macro YY_START returns an integer value 715*357f1050SThomas Veerman corresponding to the current start condition. You can return 716*357f1050SThomas Veerman to that start condition by passing the value to a subsequent 717*357f1050SThomas Veerman "BEGIN" action. You also can implement "start condition stacks" 718*357f1050SThomas Veerman by storing the values in an integer stack. 719*357f1050SThomas Veerman 720*357f1050SThomas Veerman - You can now redefine macros such as YY_INPUT by just #define'ing 721*357f1050SThomas Veerman them to some other value in the first section of the flex input; 722*357f1050SThomas Veerman no need to first #undef them. 723*357f1050SThomas Veerman 724*357f1050SThomas Veerman - flex now generates warnings for rules that can't be matched. 725*357f1050SThomas Veerman These warnings can be turned off using the new '-w' flag. If 726*357f1050SThomas Veerman your scanner uses REJECT then you will not get these warnings. 727*357f1050SThomas Veerman 728*357f1050SThomas Veerman - If you specify the '-s' flag but the default rule can be matched, 729*357f1050SThomas Veerman flex now generates a warning. 730*357f1050SThomas Veerman 731*357f1050SThomas Veerman - "yyleng" is now a global, and may be modified by the user (though 732*357f1050SThomas Veerman doing so and then using yymore() will yield weird results). 733*357f1050SThomas Veerman 734*357f1050SThomas Veerman - Name definitions in the first section of a scanner specification 735*357f1050SThomas Veerman can now include a leading '^' or trailing '$' operator. In this 736*357f1050SThomas Veerman case, the definition is *not* pushed back inside of parentheses. 737*357f1050SThomas Veerman 738*357f1050SThomas Veerman - Scanners with compressed tables are now "interactive" (-I option) 739*357f1050SThomas Veerman by default. You can suppress this attribute (which makes them 740*357f1050SThomas Veerman run slightly slower) using the new '-B' flag. 741*357f1050SThomas Veerman 742*357f1050SThomas Veerman - Flex now generates 8-bit scanners by default, unless you use the 743*357f1050SThomas Veerman -Cf or -CF compression options (-Cfe and -CFe result in 8-bit 744*357f1050SThomas Veerman scanners). You can force it to generate a 7-bit scanner using 745*357f1050SThomas Veerman the new '-7' flag. You can build flex to generate 8-bit scanners 746*357f1050SThomas Veerman for -Cf and -CF, too, by adding -DDEFAULT_CSIZE=256 to CFLAGS 747*357f1050SThomas Veerman in the Makefile. 748*357f1050SThomas Veerman 749*357f1050SThomas Veerman - You no longer need to call the scanner routine yyrestart() to 750*357f1050SThomas Veerman inform the scanner that you have switched to a new file after 751*357f1050SThomas Veerman having seen an EOF on the current input file. Instead, just 752*357f1050SThomas Veerman point yyin at the new file and continue scanning. 753*357f1050SThomas Veerman 754*357f1050SThomas Veerman - You no longer need to invoke YY_NEW_FILE in an <<EOF>> action 755*357f1050SThomas Veerman to indicate you wish to continue scanning. Simply point yyin 756*357f1050SThomas Veerman at a new file. 757*357f1050SThomas Veerman 758*357f1050SThomas Veerman - A leading '#' no longer introduces a comment in a flex input. 759*357f1050SThomas Veerman 760*357f1050SThomas Veerman - flex no longer considers formfeed ('\f') a whitespace character. 761*357f1050SThomas Veerman 762*357f1050SThomas Veerman - %t, I'm happy to report, has been nuked. 763*357f1050SThomas Veerman 764*357f1050SThomas Veerman - The '-p' option may be given twice ('-pp') to instruct flex to 765*357f1050SThomas Veerman report minor performance problems as well as major ones. 766*357f1050SThomas Veerman 767*357f1050SThomas Veerman - The '-v' verbose output no longer includes start/finish time 768*357f1050SThomas Veerman information. 769*357f1050SThomas Veerman 770*357f1050SThomas Veerman - Newlines in flex inputs can optionally include leading or 771*357f1050SThomas Veerman trailing carriage-returns ('\r'), in support of several PC/Mac 772*357f1050SThomas Veerman run-time libraries that automatically include these. 773*357f1050SThomas Veerman 774*357f1050SThomas Veerman - A start condition of the form "<*>" makes the following rule 775*357f1050SThomas Veerman active in every start condition, whether exclusive or inclusive. 776*357f1050SThomas Veerman 777*357f1050SThomas Veerman - The following items have been corrected in the flex documentation: 778*357f1050SThomas Veerman 779*357f1050SThomas Veerman - '-C' table compression options *are* cumulative. 780*357f1050SThomas Veerman 781*357f1050SThomas Veerman - You may modify yytext but not lengthen it by appending 782*357f1050SThomas Veerman characters to the end. Modifying its final character 783*357f1050SThomas Veerman will affect '^' anchoring for the next rule matched 784*357f1050SThomas Veerman if the character is changed to or from a newline. 785*357f1050SThomas Veerman 786*357f1050SThomas Veerman - The term "backtracking" has been renamed "backing up", 787*357f1050SThomas Veerman since it is a one-time repositioning and not a repeated 788*357f1050SThomas Veerman search. What used to be the "lex.backtrack" file is now 789*357f1050SThomas Veerman "lex.backup". 790*357f1050SThomas Veerman 791*357f1050SThomas Veerman - Unindented "/* ... */" comments are allowed in the first 792*357f1050SThomas Veerman flex input section, but not in the second. 793*357f1050SThomas Veerman 794*357f1050SThomas Veerman - yyless() can only be used in the flex input source, not 795*357f1050SThomas Veerman externally. 796*357f1050SThomas Veerman 797*357f1050SThomas Veerman - You can use "yyrestart(yyin)" to throw away the 798*357f1050SThomas Veerman current contents of the input buffer. 799*357f1050SThomas Veerman 800*357f1050SThomas Veerman - To write high-speed scanners, attempt to match as much 801*357f1050SThomas Veerman text as possible with each rule. See MISC/fastwc/README 802*357f1050SThomas Veerman for more information. 803*357f1050SThomas Veerman 804*357f1050SThomas Veerman - Using the beginning-of-line operator ('^') is fairly 805*357f1050SThomas Veerman cheap. Using unput() is expensive. Using yyless() is 806*357f1050SThomas Veerman cheap. 807*357f1050SThomas Veerman 808*357f1050SThomas Veerman - An example of scanning strings with embedded escape 809*357f1050SThomas Veerman sequences has been added. 810*357f1050SThomas Veerman 811*357f1050SThomas Veerman - The example of backing-up in flexdoc was erroneous; it 812*357f1050SThomas Veerman has been corrected. 813*357f1050SThomas Veerman 814*357f1050SThomas Veerman - A flex scanner's internal buffer now dynamically grows if needed 815*357f1050SThomas Veerman to match large tokens. Note that growing the buffer presently 816*357f1050SThomas Veerman requires rescanning the (large) token, so consuming a lot of 817*357f1050SThomas Veerman text this way is a slow process. Also note that presently the 818*357f1050SThomas Veerman buffer does *not* grow if you unput() more text than can fit 819*357f1050SThomas Veerman into the buffer. 820*357f1050SThomas Veerman 821*357f1050SThomas Veerman - The MISC/ directory has been reorganized; see MISC/README for 822*357f1050SThomas Veerman details. 823*357f1050SThomas Veerman 824*357f1050SThomas Veerman - yyless() can now be used in the third (user action) section 825*357f1050SThomas Veerman of a scanner specification, thanks to Ceriel Jacobs. yyless() 826*357f1050SThomas Veerman remains a macro and cannot be used outside of the scanner source. 827*357f1050SThomas Veerman 828*357f1050SThomas Veerman - The skeleton file is no longer opened at run-time, but instead 829*357f1050SThomas Veerman compiled into a large string array (thanks to John Gilmore and 830*357f1050SThomas Veerman friends at Cygnus). You can still use the -S flag to point flex 831*357f1050SThomas Veerman at a different skeleton file. 832*357f1050SThomas Veerman 833*357f1050SThomas Veerman - flex no longer uses a temporary file to store the scanner's 834*357f1050SThomas Veerman actions. 835*357f1050SThomas Veerman 836*357f1050SThomas Veerman - A number of changes have been made to decrease porting headaches. 837*357f1050SThomas Veerman In particular, flex no longer uses memset() or ctime(), and 838*357f1050SThomas Veerman provides a single simple mechanism for dealing with C compilers 839*357f1050SThomas Veerman that still define malloc() as returning char* instead of void*. 840*357f1050SThomas Veerman 841*357f1050SThomas Veerman - Flex now detects if the scanner specification requires the -8 flag 842*357f1050SThomas Veerman but the flag was not given or on by default. 843*357f1050SThomas Veerman 844*357f1050SThomas Veerman - A number of table-expansion fencepost bugs have been fixed, 845*357f1050SThomas Veerman making flex more robust for generating large scanners. 846*357f1050SThomas Veerman 847*357f1050SThomas Veerman - flex more consistently identifies the location of errors in 848*357f1050SThomas Veerman its input. 849*357f1050SThomas Veerman 850*357f1050SThomas Veerman - YY_USER_ACTION is now invoked only for "real" actions, not for 851*357f1050SThomas Veerman internal actions used by the scanner for things like filling 852*357f1050SThomas Veerman the buffer or handling EOF. 853*357f1050SThomas Veerman 854*357f1050SThomas Veerman - The rule "[^]]" now matches any character other than a ']'; 855*357f1050SThomas Veerman formerly it matched any character at all followed by a ']'. 856*357f1050SThomas Veerman This change was made for compatibility with AT&T lex. 857*357f1050SThomas Veerman 858*357f1050SThomas Veerman - A large number of miscellaneous bugs have been found and fixed 859*357f1050SThomas Veerman thanks to Gerhard Wilhelms. 860*357f1050SThomas Veerman 861*357f1050SThomas Veerman - The source code has been heavily reformatted, making patches 862*357f1050SThomas Veerman relative to previous flex releases no longer accurate. 863*357f1050SThomas Veerman 864*357f1050SThomas Veerman 865*357f1050SThomas VeermanChanges between 2.3 Patch #8 (21Feb93) and 2.3 Patch #7: 866*357f1050SThomas Veerman 867*357f1050SThomas Veerman - Fixed bugs in dynamic memory allocation leading to grievous 868*357f1050SThomas Veerman fencepost problems when generating large scanners. 869*357f1050SThomas Veerman - Fixed bug causing infinite loops on character classes with 8-bit 870*357f1050SThomas Veerman characters in them. 871*357f1050SThomas Veerman - Fixed bug in matching repetitions with a lower bound of 0. 872*357f1050SThomas Veerman - Fixed bug in scanning NUL characters using an "interactive" scanner. 873*357f1050SThomas Veerman - Fixed bug in using yymore() at the end of a file. 874*357f1050SThomas Veerman - Fixed bug in misrecognizing rules with variable trailing context. 875*357f1050SThomas Veerman - Fixed bug compiling flex on Suns using gcc 2. 876*357f1050SThomas Veerman - Fixed bug in not recognizing that input files with the character 877*357f1050SThomas Veerman ASCII 128 in them require the -8 flag. 878*357f1050SThomas Veerman - Fixed bug that could cause an infinite loop writing out 879*357f1050SThomas Veerman error messages. 880*357f1050SThomas Veerman - Fixed bug in not recognizing old-style lex % declarations if 881*357f1050SThomas Veerman followed by a tab instead of a space. 882*357f1050SThomas Veerman - Fixed potential crash when flex terminated early (usually due 883*357f1050SThomas Veerman to a bad flag) and the -v flag had been given. 884*357f1050SThomas Veerman - Added some missing declarations of void functions. 885*357f1050SThomas Veerman - Changed to only use '\a' for __STDC__ compilers. 886*357f1050SThomas Veerman - Updated mailing addresses. 887*357f1050SThomas Veerman 888*357f1050SThomas Veerman 889*357f1050SThomas VeermanChanges between 2.3 Patch #7 (28Mar91) and 2.3 Patch #6: 890*357f1050SThomas Veerman 891*357f1050SThomas Veerman - Fixed out-of-bounds array access that caused bad tables 892*357f1050SThomas Veerman to be produced on machines where the bad reference happened 893*357f1050SThomas Veerman to yield a 1. This caused problems installing or running 894*357f1050SThomas Veerman flex on some Suns, in particular. 895*357f1050SThomas Veerman 896*357f1050SThomas Veerman 897*357f1050SThomas VeermanChanges between 2.3 Patch #6 (29Aug90) and 2.3 Patch #5: 898*357f1050SThomas Veerman 899*357f1050SThomas Veerman - Fixed a serious bug in yymore() which basically made it 900*357f1050SThomas Veerman completely broken. Thanks goes to Jean Christophe of 901*357f1050SThomas Veerman the Nethack development team for finding the problem 902*357f1050SThomas Veerman and passing along the fix. 903*357f1050SThomas Veerman 904*357f1050SThomas Veerman 905*357f1050SThomas VeermanChanges between 2.3 Patch #5 (16Aug90) and 2.3 Patch #4: 906*357f1050SThomas Veerman 907*357f1050SThomas Veerman - An up-to-date version of initscan.c so "make test" will 908*357f1050SThomas Veerman work after applying the previous patches 909*357f1050SThomas Veerman 910*357f1050SThomas Veerman 911*357f1050SThomas VeermanChanges between 2.3 Patch #4 (14Aug90) and 2.3 Patch #3: 912*357f1050SThomas Veerman 913*357f1050SThomas Veerman - Fixed bug in hexadecimal escapes which allowed only digits, 914*357f1050SThomas Veerman not letters, in escapes 915*357f1050SThomas Veerman - Fixed bug in previous "Changes" file! 916*357f1050SThomas Veerman 917*357f1050SThomas Veerman 918*357f1050SThomas VeermanChanges between 2.3 Patch #3 (03Aug90) and 2.3 Patch #2: 919*357f1050SThomas Veerman 920*357f1050SThomas Veerman - Correction to patch #2 for gcc compilation; thanks goes to 921*357f1050SThomas Veerman Paul Eggert for catching this. 922*357f1050SThomas Veerman 923*357f1050SThomas Veerman 924*357f1050SThomas VeermanChanges between 2.3 Patch #2 (02Aug90) and original 2.3 release: 925*357f1050SThomas Veerman 926*357f1050SThomas Veerman - Fixed (hopefully) headaches involving declaring malloc() 927*357f1050SThomas Veerman and free() for gcc, which defines __STDC__ but (often) doesn't 928*357f1050SThomas Veerman come with the standard include files such as <stdlib.h>. 929*357f1050SThomas Veerman Reordered #ifdef maze in the scanner skeleton in the hope of 930*357f1050SThomas Veerman getting the declarations right for cfront and g++, too. 931*357f1050SThomas Veerman 932*357f1050SThomas Veerman - Note that this patch supercedes patch #1 for release 2.3, 933*357f1050SThomas Veerman which was never announced but was available briefly for 934*357f1050SThomas Veerman anonymous ftp. 935*357f1050SThomas Veerman 936*357f1050SThomas Veerman 937*357f1050SThomas VeermanChanges between 2.3 (full) release of 28Jun90 and 2.2 (alpha) release: 938*357f1050SThomas Veerman 939*357f1050SThomas VeermanUser-visible: 940*357f1050SThomas Veerman 941*357f1050SThomas Veerman - A lone <<EOF>> rule (that is, one which is not qualified with 942*357f1050SThomas Veerman a list of start conditions) now specifies the EOF action for 943*357f1050SThomas Veerman *all* start conditions which haven't already had <<EOF>> actions 944*357f1050SThomas Veerman given. To specify an end-of-file action for just the initial 945*357f1050SThomas Veerman state, use <INITIAL><<EOF>>. 946*357f1050SThomas Veerman 947*357f1050SThomas Veerman - -d debug output is now contigent on the global yy_flex_debug 948*357f1050SThomas Veerman being set to a non-zero value, which it is by default. 949*357f1050SThomas Veerman 950*357f1050SThomas Veerman - A new macro, YY_USER_INIT, is provided for the user to specify 951*357f1050SThomas Veerman initialization action to be taken on the first call to the 952*357f1050SThomas Veerman scanner. This action is done before the scanner does its 953*357f1050SThomas Veerman own initialization. 954*357f1050SThomas Veerman 955*357f1050SThomas Veerman - yy_new_buffer() has been added as an alias for yy_create_buffer() 956*357f1050SThomas Veerman 957*357f1050SThomas Veerman - Comments beginning with '#' and extending to the end of the line 958*357f1050SThomas Veerman now work, but have been deprecated (in anticipation of making 959*357f1050SThomas Veerman flex recognize #line directives). 960*357f1050SThomas Veerman 961*357f1050SThomas Veerman - The funky restrictions on when semi-colons could follow the 962*357f1050SThomas Veerman YY_NEW_FILE and yyless macros have been removed. They now 963*357f1050SThomas Veerman behave identically to functions. 964*357f1050SThomas Veerman 965*357f1050SThomas Veerman - A bug in the sample redefinition of YY_INPUT in the documentation 966*357f1050SThomas Veerman has been corrected. 967*357f1050SThomas Veerman 968*357f1050SThomas Veerman - A bug in the sample simple tokener in the documentation has 969*357f1050SThomas Veerman been corrected. 970*357f1050SThomas Veerman 971*357f1050SThomas Veerman - The documentation on the incompatibilities between flex and 972*357f1050SThomas Veerman lex has been reordered so that the discussion of yylineno 973*357f1050SThomas Veerman and input() come first, as it's anticipated that these will 974*357f1050SThomas Veerman be the most common source of headaches. 975*357f1050SThomas Veerman 976*357f1050SThomas Veerman 977*357f1050SThomas VeermanThings which didn't used to be documented but now are: 978*357f1050SThomas Veerman 979*357f1050SThomas Veerman - flex interprets "^foo|bar" differently from lex. flex interprets 980*357f1050SThomas Veerman it as "match either a 'foo' or a 'bar', providing it comes at the 981*357f1050SThomas Veerman beginning of a line", whereas lex interprets it as "match either 982*357f1050SThomas Veerman a 'foo' at the beginning of a line, or a 'bar' anywhere". 983*357f1050SThomas Veerman 984*357f1050SThomas Veerman - flex initializes the global "yyin" on the first call to the 985*357f1050SThomas Veerman scanner, while lex initializes it at compile-time. 986*357f1050SThomas Veerman 987*357f1050SThomas Veerman - yy_switch_to_buffer() can be used in the yywrap() macro/routine. 988*357f1050SThomas Veerman 989*357f1050SThomas Veerman - flex scanners do not use stdio for their input, and hence when 990*357f1050SThomas Veerman writing an interactive scanner one must explictly call fflush() 991*357f1050SThomas Veerman after writing out a prompt. 992*357f1050SThomas Veerman 993*357f1050SThomas Veerman - flex scanner can be made reentrant (after a fashion) by using 994*357f1050SThomas Veerman "yyrestart( yyin );". This is useful for interactive scanners 995*357f1050SThomas Veerman which have interrupt handlers that long-jump out of the scanner. 996*357f1050SThomas Veerman 997*357f1050SThomas Veerman - a defense of why yylineno is not supported is included, along 998*357f1050SThomas Veerman with a suggestion on how to convert scanners which rely on it. 999*357f1050SThomas Veerman 1000*357f1050SThomas Veerman 1001*357f1050SThomas VeermanOther changes: 1002*357f1050SThomas Veerman 1003*357f1050SThomas Veerman - Prototypes and proper declarations of void routines have 1004*357f1050SThomas Veerman been added to the flex source code, courtesy of Kevin B. Kenny. 1005*357f1050SThomas Veerman 1006*357f1050SThomas Veerman - Routines dealing with memory allocation now use void* pointers 1007*357f1050SThomas Veerman instead of char* - see Makefile for porting implications. 1008*357f1050SThomas Veerman 1009*357f1050SThomas Veerman - Error-checking is now done when flex closes a file. 1010*357f1050SThomas Veerman 1011*357f1050SThomas Veerman - Various lint tweaks were added to reduce the number of gripes. 1012*357f1050SThomas Veerman 1013*357f1050SThomas Veerman - Makefile has been further parameterized to aid in porting. 1014*357f1050SThomas Veerman 1015*357f1050SThomas Veerman - Support for SCO Unix added. 1016*357f1050SThomas Veerman 1017*357f1050SThomas Veerman - Flex now sports the latest & greatest UC copyright notice 1018*357f1050SThomas Veerman (which is only slightly different from the previous one). 1019*357f1050SThomas Veerman 1020*357f1050SThomas Veerman - A note has been added to flexdoc.1 mentioning work in progress 1021*357f1050SThomas Veerman on modifying flex to generate straight C code rather than a 1022*357f1050SThomas Veerman table-driven automaton, with an email address of whom to contact 1023*357f1050SThomas Veerman if you are working along similar lines. 1024*357f1050SThomas Veerman 1025*357f1050SThomas Veerman 1026*357f1050SThomas VeermanChanges between 2.2 Patch #3 (30Mar90) and 2.2 Patch #2: 1027*357f1050SThomas Veerman 1028*357f1050SThomas Veerman - fixed bug which caused -I scanners to bomb 1029*357f1050SThomas Veerman 1030*357f1050SThomas Veerman 1031*357f1050SThomas VeermanChanges between 2.2 Patch #2 (27Mar90) and 2.2 Patch #1: 1032*357f1050SThomas Veerman 1033*357f1050SThomas Veerman - fixed bug writing past end of input buffer in yyunput() 1034*357f1050SThomas Veerman - fixed bug detecting NUL's at the end of a buffer 1035*357f1050SThomas Veerman 1036*357f1050SThomas Veerman 1037*357f1050SThomas VeermanChanges between 2.2 Patch #1 (23Mar90) and 2.2 (alpha) release: 1038*357f1050SThomas Veerman 1039*357f1050SThomas Veerman - Makefile fixes: definition of MAKE variable for systems 1040*357f1050SThomas Veerman which don't have it; installation of flexdoc.1 along with 1041*357f1050SThomas Veerman flex.1; fixed two bugs which could cause "bigtest" to fail. 1042*357f1050SThomas Veerman 1043*357f1050SThomas Veerman - flex.skel fix for compiling with g++. 1044*357f1050SThomas Veerman 1045*357f1050SThomas Veerman - README and flexdoc.1 no longer list an out-of-date BITNET address 1046*357f1050SThomas Veerman for contacting me. 1047*357f1050SThomas Veerman 1048*357f1050SThomas Veerman - minor typos and formatting changes to flex.1 and flexdoc.1. 1049*357f1050SThomas Veerman 1050*357f1050SThomas Veerman 1051*357f1050SThomas VeermanChanges between 2.2 (alpha) release of March '90 and previous release: 1052*357f1050SThomas Veerman 1053*357f1050SThomas VeermanUser-visible: 1054*357f1050SThomas Veerman 1055*357f1050SThomas Veerman - Full user documentation now available. 1056*357f1050SThomas Veerman 1057*357f1050SThomas Veerman - Support for 8-bit scanners. 1058*357f1050SThomas Veerman 1059*357f1050SThomas Veerman - Scanners now accept NUL's. 1060*357f1050SThomas Veerman 1061*357f1050SThomas Veerman - A facility has been added for dealing with multiple 1062*357f1050SThomas Veerman input buffers. 1063*357f1050SThomas Veerman 1064*357f1050SThomas Veerman - Two manual entries now. One which fully describes flex 1065*357f1050SThomas Veerman (rather than just its differences from lex), and the 1066*357f1050SThomas Veerman other for quick(er) reference. 1067*357f1050SThomas Veerman 1068*357f1050SThomas Veerman - A number of changes to bring flex closer into compliance 1069*357f1050SThomas Veerman with the latest POSIX lex draft: 1070*357f1050SThomas Veerman 1071*357f1050SThomas Veerman %t support 1072*357f1050SThomas Veerman flex now accepts multiple input files and concatenates 1073*357f1050SThomas Veerman them together to form its input 1074*357f1050SThomas Veerman previous -c (compress) flag renamed -C 1075*357f1050SThomas Veerman do-nothing -c and -n flags added 1076*357f1050SThomas Veerman Any indented code or code within %{}'s in section 2 is 1077*357f1050SThomas Veerman now copied to the output 1078*357f1050SThomas Veerman 1079*357f1050SThomas Veerman - yyleng is now a bona fide global integer. 1080*357f1050SThomas Veerman 1081*357f1050SThomas Veerman - -d debug information now gives the line number of the 1082*357f1050SThomas Veerman matched rule instead of which number rule it was from 1083*357f1050SThomas Veerman the beginning of the file. 1084*357f1050SThomas Veerman 1085*357f1050SThomas Veerman - -v output now includes a summary of the flags used to generate 1086*357f1050SThomas Veerman the scanner. 1087*357f1050SThomas Veerman 1088*357f1050SThomas Veerman - unput() and yyrestart() are now globally callable. 1089*357f1050SThomas Veerman 1090*357f1050SThomas Veerman - yyrestart() no longer closes the previous value of yyin. 1091*357f1050SThomas Veerman 1092*357f1050SThomas Veerman - C++ support; generated scanners can be compiled with C++ compiler. 1093*357f1050SThomas Veerman 1094*357f1050SThomas Veerman - Primitive -lfl library added, containing default main() 1095*357f1050SThomas Veerman which calls yylex(). A number of routines currently living 1096*357f1050SThomas Veerman in the scanner skeleton will probably migrate to here 1097*357f1050SThomas Veerman in the future (in particular, yywrap() will probably cease 1098*357f1050SThomas Veerman to be a macro and instead be a function in the -lfl library). 1099*357f1050SThomas Veerman 1100*357f1050SThomas Veerman - Hexadecimal (\x) escape sequences added. 1101*357f1050SThomas Veerman 1102*357f1050SThomas Veerman - Support for MS-DOS, VMS, and Turbo-C integrated. 1103*357f1050SThomas Veerman 1104*357f1050SThomas Veerman - The %used/%unused operators have been deprecated. They 1105*357f1050SThomas Veerman may go away soon. 1106*357f1050SThomas Veerman 1107*357f1050SThomas Veerman 1108*357f1050SThomas VeermanOther changes: 1109*357f1050SThomas Veerman 1110*357f1050SThomas Veerman - Makefile enhanced for easier testing and installation. 1111*357f1050SThomas Veerman - The parser has been tweaked to detect some erroneous 1112*357f1050SThomas Veerman constructions which previously were missed. 1113*357f1050SThomas Veerman - Scanner input buffer overflow is now detected. 1114*357f1050SThomas Veerman - Bugs with missing "const" declarations fixed. 1115*357f1050SThomas Veerman - Out-of-date Minix/Atari patches provided. 1116*357f1050SThomas Veerman - Scanners no longer require printf() unless FLEX_DEBUG is being used. 1117*357f1050SThomas Veerman - A subtle input() bug has been fixed. 1118*357f1050SThomas Veerman - Line numbers for "continued action" rules (those following 1119*357f1050SThomas Veerman the special '|' action) are now correct. 1120*357f1050SThomas Veerman - unput() bug fixed; had been causing problems porting flex to VMS. 1121*357f1050SThomas Veerman - yymore() handling rewritten to fix bug with interaction 1122*357f1050SThomas Veerman between yymore() and trailing context. 1123*357f1050SThomas Veerman - EOF in actions now generates an error message. 1124*357f1050SThomas Veerman - Bug involving -CFe and generating equivalence classes fixed. 1125*357f1050SThomas Veerman - Bug which made -CF be treated as -Cf fixed. 1126*357f1050SThomas Veerman - Support for SysV tmpnam() added. 1127*357f1050SThomas Veerman - Unused #define's for scanner no longer generated. 1128*357f1050SThomas Veerman - Error messages which are associated with a particular input 1129*357f1050SThomas Veerman line are now all identified with their input line in standard 1130*357f1050SThomas Veerman format. 1131*357f1050SThomas Veerman - % directives which are valid to lex but not to flex are 1132*357f1050SThomas Veerman now ignored instead of generating warnings. 1133*357f1050SThomas Veerman - -DSYS_V flag can now also be specified -DUSG for System V 1134*357f1050SThomas Veerman compilation. 1135*357f1050SThomas Veerman 1136*357f1050SThomas Veerman 1137*357f1050SThomas VeermanChanges between 2.1 beta-test release of June '89 and previous release: 1138*357f1050SThomas Veerman 1139*357f1050SThomas VeermanUser-visible: 1140*357f1050SThomas Veerman 1141*357f1050SThomas Veerman - -p flag generates a performance report to stderr. The report 1142*357f1050SThomas Veerman consists of comments regarding features of the scanner rules 1143*357f1050SThomas Veerman which result in slower scanners. 1144*357f1050SThomas Veerman 1145*357f1050SThomas Veerman - -b flag generates backtracking information to lex.backtrack. 1146*357f1050SThomas Veerman This is a list of scanner states which require backtracking 1147*357f1050SThomas Veerman and the characters on which they do so. By adding rules 1148*357f1050SThomas Veerman one can remove backtracking states. If all backtracking states 1149*357f1050SThomas Veerman are eliminated, the generated scanner will run faster. 1150*357f1050SThomas Veerman Backtracking is not yet documented in the manual entry. 1151*357f1050SThomas Veerman 1152*357f1050SThomas Veerman - Variable trailing context now works, i.e., one can have 1153*357f1050SThomas Veerman rules like "(foo)*/[ \t]*bletch". Some trailing context 1154*357f1050SThomas Veerman patterns still cannot be properly matched and generate 1155*357f1050SThomas Veerman error messages. These are patterns where the ending of the 1156*357f1050SThomas Veerman first part of the rule matches the beginning of the second 1157*357f1050SThomas Veerman part, such as "zx*/xy*", where the 'x*' matches the 'x' at 1158*357f1050SThomas Veerman the beginning of the trailing context. Lex won't get these 1159*357f1050SThomas Veerman patterns right either. 1160*357f1050SThomas Veerman 1161*357f1050SThomas Veerman - Faster scanners. 1162*357f1050SThomas Veerman 1163*357f1050SThomas Veerman - End-of-file rules. The special rule "<<EOF>>" indicates 1164*357f1050SThomas Veerman actions which are to be taken when an end-of-file is 1165*357f1050SThomas Veerman encountered and yywrap() returns non-zero (i.e., indicates 1166*357f1050SThomas Veerman no further files to process). See manual entry for example. 1167*357f1050SThomas Veerman 1168*357f1050SThomas Veerman - The -r (reject used) flag is gone. flex now scans the input 1169*357f1050SThomas Veerman for occurrences of the string "REJECT" to determine if the 1170*357f1050SThomas Veerman action is needed. It tries to be intelligent about this but 1171*357f1050SThomas Veerman can be fooled. One can force the presence or absence of 1172*357f1050SThomas Veerman REJECT by adding a line in the first section of the form 1173*357f1050SThomas Veerman "%used REJECT" or "%unused REJECT". 1174*357f1050SThomas Veerman 1175*357f1050SThomas Veerman - yymore() has been implemented. Similarly to REJECT, flex 1176*357f1050SThomas Veerman detects the use of yymore(), which can be overridden using 1177*357f1050SThomas Veerman "%used" or "%unused". 1178*357f1050SThomas Veerman 1179*357f1050SThomas Veerman - Patterns like "x{0,3}" now work (i.e., with lower-limit == 0). 1180*357f1050SThomas Veerman 1181*357f1050SThomas Veerman - Removed '\^x' for ctrl-x misfeature. 1182*357f1050SThomas Veerman 1183*357f1050SThomas Veerman - Added '\a' and '\v' escape sequences. 1184*357f1050SThomas Veerman 1185*357f1050SThomas Veerman - \<digits> now works for octal escape sequences; previously 1186*357f1050SThomas Veerman \0<digits> was required. 1187*357f1050SThomas Veerman 1188*357f1050SThomas Veerman - Better error reporting; line numbers are associated with rules. 1189*357f1050SThomas Veerman 1190*357f1050SThomas Veerman - yyleng is a macro; it cannot be accessed outside of the 1191*357f1050SThomas Veerman scanner source file. 1192*357f1050SThomas Veerman 1193*357f1050SThomas Veerman - yytext and yyleng should not be modified within a flex action. 1194*357f1050SThomas Veerman 1195*357f1050SThomas Veerman - Generated scanners #define the name FLEX_SCANNER. 1196*357f1050SThomas Veerman 1197*357f1050SThomas Veerman - Rules are internally separated by YY_BREAK in lex.yy.c rather 1198*357f1050SThomas Veerman than break, to allow redefinition. 1199*357f1050SThomas Veerman 1200*357f1050SThomas Veerman - The macro YY_USER_ACTION can be redefined to provide an action 1201*357f1050SThomas Veerman which is always executed prior to the matched rule's action. 1202*357f1050SThomas Veerman 1203*357f1050SThomas Veerman - yyrestart() is a new action which can be used to restart 1204*357f1050SThomas Veerman the scanner after it has seen an end-of-file (a "real" one, 1205*357f1050SThomas Veerman that is, one for which yywrap() returned non-zero). It takes 1206*357f1050SThomas Veerman a FILE* argument indicating a new file to scan and sets 1207*357f1050SThomas Veerman things up so that a subsequent call to yylex() will start 1208*357f1050SThomas Veerman scanning that file. 1209*357f1050SThomas Veerman 1210*357f1050SThomas Veerman - Internal scanner names all preceded by "yy_" 1211*357f1050SThomas Veerman 1212*357f1050SThomas Veerman - lex.yy.c is deleted if errors are encountered during processing. 1213*357f1050SThomas Veerman 1214*357f1050SThomas Veerman - Comments may be put in the first section of the input by preceding 1215*357f1050SThomas Veerman them with '#'. 1216*357f1050SThomas Veerman 1217*357f1050SThomas Veerman 1218*357f1050SThomas Veerman 1219*357f1050SThomas VeermanOther changes: 1220*357f1050SThomas Veerman 1221*357f1050SThomas Veerman - Some portability-related bugs fixed, in particular for machines 1222*357f1050SThomas Veerman with unsigned characters or sizeof( int* ) != sizeof( int ). 1223*357f1050SThomas Veerman Also, tweaks for VMS and Microsoft C (MS-DOS), and identifiers all 1224*357f1050SThomas Veerman trimmed to be 31 or fewer characters. Shortened file names 1225*357f1050SThomas Veerman for dinosaur OS's. Checks for allocating > 64K memory 1226*357f1050SThomas Veerman on 16 bit'ers. Amiga tweaks. Compiles using gcc on a Sun-3. 1227*357f1050SThomas Veerman - Compressed and fast scanner skeletons merged. 1228*357f1050SThomas Veerman - Skeleton header files done away with. 1229*357f1050SThomas Veerman - Generated scanner uses prototypes and "const" for __STDC__. 1230*357f1050SThomas Veerman - -DSV flag is now -DSYS_V for System V compilation. 1231*357f1050SThomas Veerman - Removed all references to FTL language. 1232*357f1050SThomas Veerman - Software now covered by BSD Copyright. 1233*357f1050SThomas Veerman - flex will replace lex in subsequent BSD releases. 1234