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