Upgrade to Flex version 2.4.3.

This commit is contained in:
jtc 1993-12-06 19:29:01 +00:00
parent e3597376a1
commit 1ec64166fe
42 changed files with 262 additions and 190 deletions

View File

@ -33,6 +33,6 @@ This basically says "do whatever you please with this software except
remove this notice or take advantage of the University's (or the flex
authors') name".
Note that the "flex.skel" scanner skeleton carries no copyright notice.
Note that the "flex.skl" scanner skeleton carries no copyright notice.
You are free to do whatever you please with scanners generated using flex;
for them, you are not even bound by the above copyright.

View File

@ -1,4 +1,4 @@
// $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/FlexLexer.h,v 1.1 1993/12/02 19:17:24 jtc Exp $
// $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/FlexLexer.h,v 1.2 1993/12/06 19:29:02 jtc Exp $
// FlexLexer.h -- define classes for lexical analyzers generated by flex
@ -35,6 +35,10 @@
// If you want to create multiple lexer classes, you use the -P flag
// to rename each yyFlexLexer to some other xxFlexLexer.
#include <iostream.h>
struct yy_buffer_state;
typedef int yy_state_type;
class FlexLexer {
public:
@ -43,9 +47,11 @@ public:
const char* YYText() { return yytext; }
int YYLeng() { return yyleng; }
virtual void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) = 0;
virtual YY_BUFFER_STATE yy_create_buffer( istream* s, int size ) = 0;
virtual void yy_delete_buffer( YY_BUFFER_STATE b ) = 0;
virtual void
yy_switch_to_buffer( struct yy_buffer_state* new_buffer ) = 0;
virtual struct yy_buffer_state*
yy_create_buffer( istream* s, int size ) = 0;
virtual void yy_delete_buffer( struct yy_buffer_state* b ) = 0;
virtual void yyrestart( istream* s ) = 0;
virtual int yylex() = 0;
@ -88,9 +94,9 @@ public:
delete yy_state_buf;
}
void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer );
YY_BUFFER_STATE yy_create_buffer( istream* s, int size );
void yy_delete_buffer( YY_BUFFER_STATE b );
void yy_switch_to_buffer( struct yy_buffer_state* new_buffer );
struct yy_buffer_state* yy_create_buffer( istream* s, int size );
void yy_delete_buffer( struct yy_buffer_state* b );
void yyrestart( istream* s );
virtual int yylex();
@ -103,7 +109,7 @@ protected:
int yyinput();
void yy_load_buffer_state();
void yy_init_buffer( YY_BUFFER_STATE b, istream* s );
void yy_init_buffer( struct yy_buffer_state* b, istream* s );
yy_state_type yy_get_previous_state();
yy_state_type yy_try_NUL_trans( yy_state_type current_state );
@ -112,7 +118,7 @@ protected:
istream* yyin; // input source for default LexerInput
ostream* yyout; // output sink for default LexerOutput
YY_BUFFER_STATE yy_current_buffer;
struct yy_buffer_state* yy_current_buffer;
// yy_hold_char holds the character lost when yytext is formed.
char yy_hold_char;

View File

@ -1 +1 @@
2.4.2, available from ftp.ee.lbl.gov or prep.gnu.ai.mit.edu
2.4.3, available from ftp.ee.lbl.gov or prep.gnu.ai.mit.edu

View File

@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/ccl.c,v 1.4 1993/12/02 19:17:29 jtc Exp $ */
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/ccl.c,v 1.5 1993/12/06 19:29:05 jtc Exp $ */
#include "flexdef.h"

View File

@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/dfa.c,v 1.4 1993/12/02 19:17:30 jtc Exp $ */
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/dfa.c,v 1.5 1993/12/06 19:29:06 jtc Exp $ */
#include "flexdef.h"

View File

@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/ecs.c,v 1.4 1993/12/02 19:17:33 jtc Exp $ */
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/ecs.c,v 1.5 1993/12/06 19:29:08 jtc Exp $ */
#include "flexdef.h"

View File

@ -190,9 +190,11 @@ scanner table representation should be used (and stdio bypassed).
This representation is about as fast as the full table representation
.B (-f),
and for some sets of patterns will be considerably smaller (and for
others, larger). See
others, larger). It cannot be used with the
.B \-+
option. See
.B flexdoc(1)
for details.
for more details.
.IP
This option is equivalent to
.B \-CFr
@ -325,7 +327,8 @@ different states.
.B \-CF
specifies that the alternate fast scanner representation (described in
.B flexdoc(1))
should be used.
should be used. This option cannot be used with
.B \-+.
.IP
.B \-Cm
directs
@ -525,9 +528,9 @@ of the scanner's actions it will slow down
of the scanner's matching. Furthermore,
.B REJECT
cannot be used with the
.I -f
.B \-f
or
.I -F
.B \-F
options.
.IP
Note also that unlike the other special actions,
@ -807,10 +810,9 @@ scanner complaining about the following missing routines:
.ds
yywrap
yy_flex_alloc
yy_flex_realloc
yy_flex_free
...
.de
then you forgot to link your program with
(and various others) then you forgot to link your program with
.B \-lfl.
.PP
.I reject_used_but_not_detected undefined
@ -995,9 +997,9 @@ and somewhat greater than the number of states if it does.
.PP
.B REJECT
cannot be used with the
.I -f
.B \-f
or
.I -F
.B \-F
options.
.PP
The

View File

@ -1,12 +1,14 @@
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/flex.skl,v 1.1 1993/12/02 19:17:36 jtc Exp $
* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/flex.skl,v 1.2 1993/12/06 19:29:11 jtc Exp $
*/
#define FLEX_SCANNER
%-
#include <stdio.h>
%*
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
@ -21,7 +23,7 @@
#include <stdlib.h>
%+
#include <iostream.h>
class istream;
%*
#include <unistd.h>
@ -101,6 +103,7 @@ extern "C" {
extern void *yy_flex_realloc YY_PROTO(( void *ptr, int size ));
extern void yy_flex_free YY_PROTO(( void * ));
extern int yywrap YY_PROTO(( void ));
extern void yy_strcpy YY_PROTO(( char *s1, const char *s2 ));
#ifdef __cplusplus
}
#endif
@ -1000,7 +1003,7 @@ char msg[];
#endif
{
%-
(void) putc( '\n', stderr );
(void) fprintf( stderr, "%s\n", msg );
%+
cerr << msg << '\n';
%*

View File

@ -26,10 +26,9 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* @(#) $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/flexdef.h,v 1.5 1993/12/02 19:17:37 jtc Exp $ (LBL) */
/* @(#) $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/flexdef.h,v 1.6 1993/12/06 19:29:13 jtc Exp $ (LBL) */
#include <stdio.h>
#include <string.h>
#include <ctype.h>
/* Always be prepared to generate an 8-bit scanner. */
@ -549,7 +548,7 @@ extern char **scname;
extern int current_max_dfa_size, current_max_xpairs;
extern int current_max_template_xpairs, current_max_dfas;
extern int lastdfa, lasttemp, *nxt, *chk, *tnxt;
extern int lastdfa, *nxt, *chk, *tnxt;
extern int *base, *def, *nultrans, NUL_ec, tblend, firstfree, **dss, *dfasiz;
extern union dfaacc_union
{
@ -608,7 +607,9 @@ void *reallocate_array PROTO((void*, int, int));
void *yy_flex_alloc PROTO((int));
void *yy_flex_realloc PROTO((void*, int));
void yy_flex_free PROTO((void*));
void *yy_flex_xmalloc PROTO((int));
int yy_strcmp PROTO(( const char *s1, const char *s2 ));
void yy_strcpy PROTO(( char *s1, const char *s2 ));
int yy_strlen PROTO(( const char *s ));
#define allocate_integer_array(size) \
(int *) allocate_array( size, sizeof( int ) )
@ -767,6 +768,9 @@ extern void skelout PROTO((void));
/* Output a yy_trans_info structure. */
extern void transition_struct_out PROTO((int, int));
/* Only needed when using certain broken versions of bison to build parse.c. */
extern void *yy_flex_xmalloc PROTO(( int ));
/* Set a region of memory to 0. */
extern void zero_out PROTO((char *, int));

View File

@ -1715,7 +1715,8 @@ to detect the keywords, you're better off using
.IP
This option is equivalent to
.B \-CFr
(see below).
(see below). It cannot be used with
.B \-+.
.TP
.B \-I
instructs
@ -1905,7 +1906,8 @@ specifies that the alternate fast scanner representation (described
above under the
.B \-F
flag)
should be used.
should be used. This option cannot be used with
.B \-+.
.IP
.B \-Cm
directs
@ -2855,10 +2857,9 @@ scanner complaining about the following missing routines:
.ds
yywrap
yy_flex_alloc
yy_flex_realloc
yy_flex_free
...
.de
then you forgot to link your program with
(and various others) then you forgot to link your program with
.B \-lfl.
This run-time library is
.I required
@ -3001,20 +3002,23 @@ Casey Leedom,
Nelson H.F. Beebe, benson@odi.com, Peter A. Bigot, Keith Bostic, Frederic
Brehm, Nick Christopher, Jason Coughlin, Bill Cox, Dave Curtis, Scott David
Daniels, Chris G. Demetriou, Mike Donahue, Chuck Doucette, Tom Epperly, Leo
Eskin, Chris Faylor, Jon Forrest, Eric Goldman, Ulrich Grepel, Jan Hajic,
Jarkko Hietaniemi, Eric Hughes, Ceriel Jacobs, Jeffrey R. Jones, Henry
Eskin, Chris Faylor, Jon Forrest, Kaveh R. Ghazi,
Eric Goldman, Ulrich Grepel, Jan Hajic,
Jarkko Hietaniemi, Eric Hughes, John Interrante,
Ceriel Jacobs, Jeffrey R. Jones, Henry
Juengst, Amir Katz, ken@ken.hilco.com, Kevin B. Kenny, Marq Kole, Ronald
Lamprecht, Greg Lee, Craig Leres, John Levine, Mohamed el Lozy, Chris
Metcalf, Luke Mewburn, Jim Meyering, G.T. Nicol, Landon Noll, Marc Nozell,
Richard Ohnemus, Sven Panne, Roland Pesch, Walter Pelissero, Gaumond
Pierre, Esmond Pitt, Jef Poskanzer, Kevin Rodgers, Jim
Pierre, Esmond Pitt, Jef Poskanzer, Joe Rahmeh, Kevin Rodgers, Jim
Roskind, Doug Schmidt, Alex Siegel, Paul Stuart, Dave Tallman, Paul
Tuinenga, Gary Weik, Frank Whaley, Gerhard Wilhelms, Kent Williams, Ken
Yap, Nathan Zelle, David Zuhn, and those whose names have slipped my marginal
mail-archiving skills but whose contributions are appreciated all the
same.
.PP
Thanks to Keith Bostic, John Gilmore, Craig Leres, Bob Mulcahy, G.T.
Thanks to Keith Bostic, Noah Friedman,
John Gilmore, Craig Leres, Bob Mulcahy, G.T.
Nicol, Francois Pinard, Rich Salz, and Richard Stallman for help with various
distribution headaches.
.PP

View File

@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/gen.c,v 1.4 1993/12/02 19:17:43 jtc Exp $ */
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/gen.c,v 1.5 1993/12/06 19:29:19 jtc Exp $ */
#include "flexdef.h"
@ -594,7 +594,7 @@ int worry_about_NULs;
}
else
(void) strcpy( char_map,
yy_strcpy( char_map,
useecs ? "yy_ec[(unsigned int) *yy_cp]" : "*yy_cp" );
if ( worry_about_NULs && nultrans )
@ -1052,7 +1052,7 @@ void make_tables()
indent_puts(
"YY_FATAL_ERROR( \"token too large, exceeds YYLMAX\" ); \\" );
indent_down();
indent_puts( "strcpy( yytext, yytext_ptr ); \\" );
indent_puts( "yy_strcpy( yytext, yytext_ptr ); \\" );
}
set_indent( 0 );
@ -1255,7 +1255,7 @@ void make_tables()
printf(
"\tif ( yy_current_buffer->is_interactive ) \\\n" );
printf(
"\t\tresult = (buf[0] = getc( yyin )) == EOF ? 0 : 1; \\\n" );
"\t\tresult = ((int) (buf[0] = getc( yyin ))) == EOF ? 0 : 1; \\\n" );
printf(
"\telse if ( ((result = fread( (char *) buf, 1, max_size, yyin )) == 0)\\\n" );
printf( "\t\t && ferror( yyin ) ) \\\n" );

View File

@ -1,7 +1,7 @@
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/initscan.c,v 1.4 1993/12/02 19:17:46 jtc Exp $
* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/initscan.c,v 1.5 1993/12/06 19:29:22 jtc Exp $
*/
#define FLEX_SCANNER
@ -96,6 +96,7 @@ extern "C" {
extern void *yy_flex_realloc YY_PROTO(( void *ptr, int size ));
extern void yy_flex_free YY_PROTO(( void * ));
extern int yywrap YY_PROTO(( void ));
extern void yy_strcpy YY_PROTO(( char *s1, const char *s2 ));
#ifdef __cplusplus
}
#endif
@ -866,7 +867,7 @@ char *yytext;
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/initscan.c,v 1.4 1993/12/02 19:17:46 jtc Exp $ */
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/initscan.c,v 1.5 1993/12/06 19:29:22 jtc Exp $ */
#include "flexdef.h"
#include "parse.h"
@ -882,11 +883,11 @@ char *yytext;
return CHAR;
#define RETURNNAME \
(void) strcpy( nmstr, yytext ); \
yy_strcpy( nmstr, yytext ); \
return NAME;
#define PUT_BACK_STRING(str, start) \
for ( i = strlen( str ) - 1; i >= start; --i ) \
for ( i = yy_strlen( str ) - 1; i >= start; --i ) \
unput((str)[i])
#define CHECK_REJECT(str) \
@ -921,7 +922,7 @@ char *yytext;
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
if ( yy_current_buffer->is_interactive ) \
result = (buf[0] = getc( yyin )) == EOF ? 0 : 1; \
result = ((int) (buf[0] = getc( yyin ))) == EOF ? 0 : 1; \
else if ( ((result = fread( (char *) buf, 1, max_size, yyin )) == 0)\
&& ferror( yyin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" );
@ -1139,7 +1140,7 @@ synerr( "unrecognized '%' directive" );
case 14:
# line 141 "scan.l"
{
(void) strcpy( nmstr, yytext );
yy_strcpy( nmstr, yytext );
didadef = false;
BEGIN(PICKUPDEF);
}
@ -1208,10 +1209,10 @@ case 28:
case 29:
# line 173 "scan.l"
{
(void) strcpy( (char *) nmdef, yytext );
yy_strcpy( (char *) nmdef, yytext );
/* Skip trailing whitespace. */
for ( i = strlen( (char *) nmdef ) - 1;
for ( i = yy_strlen( (char *) nmdef ) - 1;
i >= 0 && (nmdef[i] == ' ' || nmdef[i] == '\t');
--i )
;
@ -1407,7 +1408,7 @@ case 57:
{
int cclval;
(void) strcpy( nmstr, yytext );
yy_strcpy( nmstr, yytext );
/* Check to see if we've already encountered this
* ccl.
@ -1444,7 +1445,7 @@ case 58:
register Char *nmdefptr;
Char *ndlookup();
(void) strcpy( nmstr, yytext + 1 );
yy_strcpy( nmstr, yytext + 1 );
nmstr[yyleng - 2] = '\0'; /* chop trailing brace */
if ( ! (nmdefptr = ndlookup( nmstr )) )
@ -1453,7 +1454,7 @@ case 58:
else
{ /* push back name surrounded by ()'s */
int len = strlen( (char *) nmdefptr );
int len = yy_strlen( (char *) nmdefptr );
if ( lex_compat || nmdefptr[0] == '^' ||
(len > 0 && nmdefptr[len - 1] == '$') )
@ -2344,7 +2345,7 @@ static void yy_fatal_error( msg )
char msg[];
#endif
{
(void) putc( '\n', stderr );
(void) fprintf( stderr, "%s\n", msg );
exit( 1 );
}

View File

@ -32,7 +32,7 @@ char copyright[] =
All rights reserved.\n";
#endif /* not lint */
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/main.c,v 1.4 1993/12/02 19:17:50 jtc Exp $ */
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/main.c,v 1.5 1993/12/06 19:29:25 jtc Exp $ */
#include "flexdef.h"
@ -315,7 +315,7 @@ int exit_status;
if ( skelname )
fprintf( stderr, " -S%s", skelname );
if ( strcmp( prefix, "yy" ) )
if ( yy_strcmp( prefix, "yy" ) )
fprintf( stderr, " -P%s", prefix );
putc( '\n', stderr );
@ -449,7 +449,7 @@ char **argv;
program_name = argv[0];
if ( program_name[0] != '\0' &&
program_name[strlen( program_name ) - 1] == '+' )
program_name[yy_strlen( program_name ) - 1] == '+' )
C_plus_plus = true;
/* read flags */
@ -677,13 +677,16 @@ char **argv;
}
if ( (fulltbl || fullspd) && usemecs )
flexerror( "-f/-F and -Cm don't make sense together" );
flexerror( "-Cf/-CF and -Cm don't make sense together" );
if ( (fulltbl || fullspd) && interactive )
flexerror( "-f/-F and -I are incompatible" );
flexerror( "-Cf/-CF and -I are incompatible" );
if ( fulltbl && fullspd )
flexerror( "-f and -F are mutually exclusive" );
flexerror( "-Cf and -CF are mutually exclusive" );
if ( C_plus_plus && fullspd )
flexerror( "Can't use -+ with -CF option" );
if ( ! use_stdout )
{
@ -731,7 +734,7 @@ char **argv;
if ( skelname && (skelfile = fopen( skelname, "r" )) == NULL )
lerrsf( "can't open skeleton file %s", skelname );
if ( strcmp( prefix, "yy" ) )
if ( yy_strcmp( prefix, "yy" ) )
{
#define GEN_PREFIX(name) printf( "#define yy%s %s%s\n", name, prefix, name );
GEN_PREFIX( "FlexLexer" );
@ -830,7 +833,7 @@ void readin()
if ( fullspd )
printf(
"typedef const struct yy_trans_info *yy_state_type;\n" );
else
else if ( ! C_plus_plus )
printf( "typedef int yy_state_type;\n" );
if ( reject )
@ -845,7 +848,7 @@ void readin()
printf( "extern int yylineno;\n" );
printf( "int yylineno = 1;\n" );
}
else
else if ( ! C_plus_plus )
printf( "FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;\n" );
if ( C_plus_plus )
@ -854,10 +857,7 @@ void readin()
else
{
if ( yytext_is_array )
{
puts( "\n#include <string.h>\n" );
puts( "extern char yytext[];\n" );
}
else
{

View File

@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/misc.c,v 1.4 1993/12/02 19:17:51 jtc Exp $ */
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/misc.c,v 1.5 1993/12/06 19:29:27 jtc Exp $ */
#include "flexdef.h"
@ -41,7 +41,7 @@ int otoi PROTO((Char []));
void add_action( new_text )
char *new_text;
{
int len = strlen( new_text );
int len = yy_strlen( new_text );
while ( len + action_index >= action_size - 10 /* slop */ )
{
@ -50,7 +50,7 @@ char *new_text;
reallocate_character_array( action_array, action_size );
}
strcpy( &action_array[action_index], new_text );
yy_strcpy( &action_array[action_index], new_text );
action_index += len;
}
@ -501,7 +501,6 @@ Char myesc( array )
Char array[];
{
Char c, esc_char;
register int sptr;
switch ( array[1] )
{
@ -530,7 +529,7 @@ Char array[];
case '8':
case '9':
{ /* \<octal> */
sptr = 1;
int sptr = 1;
while ( isascii( array[sptr] ) &&
isdigit( array[sptr] ) )
@ -740,6 +739,21 @@ int element_v, element_n;
}
/* The following is only needed when building flex's parser using certain
* broken versions of bison.
*/
void *yy_flex_xmalloc( size )
int size;
{
void *result = yy_flex_alloc( size );
if ( ! result )
flexfatal( "memory allocation failed in yy_flex_xmalloc()" );
return result;
}
/* zero_out - set a region of memory to 0
*
* Sets region_ptr[0] through region_ptr[size_in_bytes - 1] to zero.

View File

@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/nfa.c,v 1.4 1993/12/02 19:17:54 jtc Exp $ */
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/nfa.c,v 1.5 1993/12/06 19:29:29 jtc Exp $ */
#include "flexdef.h"

View File

@ -29,7 +29,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/parse.y,v 1.4 1993/12/02 19:17:56 jtc Exp $ */
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/parse.y,v 1.5 1993/12/06 19:29:30 jtc Exp $ */
/* Some versions of bison are broken in that they use alloca() but don't

View File

@ -27,7 +27,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/scan.l,v 1.4 1993/12/02 19:17:59 jtc Exp $ */
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/scan.l,v 1.5 1993/12/06 19:29:31 jtc Exp $ */
#include "flexdef.h"
#include "parse.h"
@ -43,11 +43,11 @@
return CHAR;
#define RETURNNAME \
(void) strcpy( nmstr, yytext ); \
yy_strcpy( nmstr, yytext ); \
return NAME;
#define PUT_BACK_STRING(str, start) \
for ( i = strlen( str ) - 1; i >= start; --i ) \
for ( i = yy_strlen( str ) - 1; i >= start; --i ) \
unput((str)[i])
#define CHECK_REJECT(str) \
@ -139,7 +139,7 @@ CCL_CHAR ([^\\\n\]]|{ESCSEQ})
^"%"[^sxanpekotcru{}].* synerr( "unrecognized '%' directive" );
^{NAME} {
(void) strcpy( nmstr, yytext );
yy_strcpy( nmstr, yytext );
didadef = false;
BEGIN(PICKUPDEF);
}
@ -171,10 +171,10 @@ CCL_CHAR ([^\\\n\]]|{ESCSEQ})
<PICKUPDEF>{WS} /* separates name and definition */
<PICKUPDEF>{NOT_WS}.* {
(void) strcpy( (char *) nmdef, yytext );
yy_strcpy( (char *) nmdef, yytext );
/* Skip trailing whitespace. */
for ( i = strlen( (char *) nmdef ) - 1;
for ( i = yy_strlen( (char *) nmdef ) - 1;
i >= 0 && (nmdef[i] == ' ' || nmdef[i] == '\t');
--i )
;
@ -296,7 +296,7 @@ CCL_CHAR ([^\\\n\]]|{ESCSEQ})
<SECT2>"["{FIRST_CCL_CHAR}{CCL_CHAR}* {
int cclval;
(void) strcpy( nmstr, yytext );
yy_strcpy( nmstr, yytext );
/* Check to see if we've already encountered this
* ccl.
@ -331,7 +331,7 @@ CCL_CHAR ([^\\\n\]]|{ESCSEQ})
register Char *nmdefptr;
Char *ndlookup();
(void) strcpy( nmstr, yytext + 1 );
yy_strcpy( nmstr, yytext + 1 );
nmstr[yyleng - 2] = '\0'; /* chop trailing brace */
if ( ! (nmdefptr = ndlookup( nmstr )) )
@ -340,7 +340,7 @@ CCL_CHAR ([^\\\n\]]|{ESCSEQ})
else
{ /* push back name surrounded by ()'s */
int len = strlen( (char *) nmdefptr );
int len = yy_strlen( (char *) nmdefptr );
if ( lex_compat || nmdefptr[0] == '^' ||
(len > 0 && nmdefptr[len - 1] == '$') )

View File

@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/sym.c,v 1.4 1993/12/02 19:18:00 jtc Exp $ */
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/sym.c,v 1.5 1993/12/06 19:29:33 jtc Exp $ */
#include "flexdef.h"
@ -62,7 +62,7 @@ int table_size;
while ( sym_entry )
{
if ( ! strcmp( sym, sym_entry->name ) )
if ( ! yy_strcmp( sym, sym_entry->name ) )
{ /* entry already exists */
return -1;
}
@ -134,14 +134,15 @@ int table_size;
{
static struct hash_entry empty_entry =
{
(struct hash_entry *) 0, (struct hash_entry *) 0, NULL, NULL, 0,
(struct hash_entry *) 0, (struct hash_entry *) 0,
(char *) 0, (char *) 0, 0,
} ;
register struct hash_entry *sym_entry =
table[hashfunct( sym, table_size )];
while ( sym_entry )
{
if ( ! strcmp( sym, sym_entry->name ) )
if ( ! yy_strcmp( sym, sym_entry->name ) )
return sym_entry;
sym_entry = sym_entry->next;
}
@ -174,14 +175,15 @@ int hash_size;
/* ndinstal - install a name definition */
void ndinstal( nd, def )
char nd[];
Char def[];
void ndinstal( name, definition )
char name[];
Char definition[];
{
char *copy_string();
Char *copy_unsigned_string();
if ( addsym( copy_string( nd ), (char *) copy_unsigned_string( def ), 0,
if ( addsym( copy_string( name ),
(char *) copy_unsigned_string( definition ), 0,
ndtbl, NAME_TABLE_HASH_SIZE ) )
synerr( "name defined twice" );
}

View File

@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/tblcmp.c,v 1.4 1993/12/02 19:18:02 jtc Exp $ */
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/tblcmp.c,v 1.5 1993/12/06 19:29:35 jtc Exp $ */
#include "flexdef.h"

View File

@ -1 +1 @@
#define FLEX_VERSION "2.4.2"
#define FLEX_VERSION "2.4.3"

View File

@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/yylex.c,v 1.4 1993/12/02 19:18:05 jtc Exp $ */
/* $Header: /cvsroot/src/gnu/usr.bin/lex/Attic/yylex.c,v 1.5 1993/12/06 19:29:38 jtc Exp $ */
#include <ctype.h>
#include "flexdef.h"

View File

@ -33,6 +33,6 @@ This basically says "do whatever you please with this software except
remove this notice or take advantage of the University's (or the flex
authors') name".
Note that the "flex.skel" scanner skeleton carries no copyright notice.
Note that the "flex.skl" scanner skeleton carries no copyright notice.
You are free to do whatever you please with scanners generated using flex;
for them, you are not even bound by the above copyright.

View File

@ -1,4 +1,4 @@
// $Header: /cvsroot/src/usr.bin/lex/Attic/FlexLexer.h,v 1.1 1993/12/02 19:17:24 jtc Exp $
// $Header: /cvsroot/src/usr.bin/lex/Attic/FlexLexer.h,v 1.2 1993/12/06 19:29:02 jtc Exp $
// FlexLexer.h -- define classes for lexical analyzers generated by flex
@ -35,6 +35,10 @@
// If you want to create multiple lexer classes, you use the -P flag
// to rename each yyFlexLexer to some other xxFlexLexer.
#include <iostream.h>
struct yy_buffer_state;
typedef int yy_state_type;
class FlexLexer {
public:
@ -43,9 +47,11 @@ public:
const char* YYText() { return yytext; }
int YYLeng() { return yyleng; }
virtual void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) = 0;
virtual YY_BUFFER_STATE yy_create_buffer( istream* s, int size ) = 0;
virtual void yy_delete_buffer( YY_BUFFER_STATE b ) = 0;
virtual void
yy_switch_to_buffer( struct yy_buffer_state* new_buffer ) = 0;
virtual struct yy_buffer_state*
yy_create_buffer( istream* s, int size ) = 0;
virtual void yy_delete_buffer( struct yy_buffer_state* b ) = 0;
virtual void yyrestart( istream* s ) = 0;
virtual int yylex() = 0;
@ -88,9 +94,9 @@ public:
delete yy_state_buf;
}
void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer );
YY_BUFFER_STATE yy_create_buffer( istream* s, int size );
void yy_delete_buffer( YY_BUFFER_STATE b );
void yy_switch_to_buffer( struct yy_buffer_state* new_buffer );
struct yy_buffer_state* yy_create_buffer( istream* s, int size );
void yy_delete_buffer( struct yy_buffer_state* b );
void yyrestart( istream* s );
virtual int yylex();
@ -103,7 +109,7 @@ protected:
int yyinput();
void yy_load_buffer_state();
void yy_init_buffer( YY_BUFFER_STATE b, istream* s );
void yy_init_buffer( struct yy_buffer_state* b, istream* s );
yy_state_type yy_get_previous_state();
yy_state_type yy_try_NUL_trans( yy_state_type current_state );
@ -112,7 +118,7 @@ protected:
istream* yyin; // input source for default LexerInput
ostream* yyout; // output sink for default LexerOutput
YY_BUFFER_STATE yy_current_buffer;
struct yy_buffer_state* yy_current_buffer;
// yy_hold_char holds the character lost when yytext is formed.
char yy_hold_char;

View File

@ -1 +1 @@
2.4.2, available from ftp.ee.lbl.gov or prep.gnu.ai.mit.edu
2.4.3, available from ftp.ee.lbl.gov or prep.gnu.ai.mit.edu

View File

@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header: /cvsroot/src/usr.bin/lex/Attic/ccl.c,v 1.4 1993/12/02 19:17:29 jtc Exp $ */
/* $Header: /cvsroot/src/usr.bin/lex/Attic/ccl.c,v 1.5 1993/12/06 19:29:05 jtc Exp $ */
#include "flexdef.h"

View File

@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header: /cvsroot/src/usr.bin/lex/Attic/dfa.c,v 1.4 1993/12/02 19:17:30 jtc Exp $ */
/* $Header: /cvsroot/src/usr.bin/lex/Attic/dfa.c,v 1.5 1993/12/06 19:29:06 jtc Exp $ */
#include "flexdef.h"

View File

@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header: /cvsroot/src/usr.bin/lex/Attic/ecs.c,v 1.4 1993/12/02 19:17:33 jtc Exp $ */
/* $Header: /cvsroot/src/usr.bin/lex/Attic/ecs.c,v 1.5 1993/12/06 19:29:08 jtc Exp $ */
#include "flexdef.h"

View File

@ -190,9 +190,11 @@ scanner table representation should be used (and stdio bypassed).
This representation is about as fast as the full table representation
.B (-f),
and for some sets of patterns will be considerably smaller (and for
others, larger). See
others, larger). It cannot be used with the
.B \-+
option. See
.B flexdoc(1)
for details.
for more details.
.IP
This option is equivalent to
.B \-CFr
@ -325,7 +327,8 @@ different states.
.B \-CF
specifies that the alternate fast scanner representation (described in
.B flexdoc(1))
should be used.
should be used. This option cannot be used with
.B \-+.
.IP
.B \-Cm
directs
@ -525,9 +528,9 @@ of the scanner's actions it will slow down
of the scanner's matching. Furthermore,
.B REJECT
cannot be used with the
.I -f
.B \-f
or
.I -F
.B \-F
options.
.IP
Note also that unlike the other special actions,
@ -807,10 +810,9 @@ scanner complaining about the following missing routines:
.ds
yywrap
yy_flex_alloc
yy_flex_realloc
yy_flex_free
...
.de
then you forgot to link your program with
(and various others) then you forgot to link your program with
.B \-lfl.
.PP
.I reject_used_but_not_detected undefined
@ -995,9 +997,9 @@ and somewhat greater than the number of states if it does.
.PP
.B REJECT
cannot be used with the
.I -f
.B \-f
or
.I -F
.B \-F
options.
.PP
The

View File

@ -1,12 +1,14 @@
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
* $Header: /cvsroot/src/usr.bin/lex/Attic/flex.skl,v 1.1 1993/12/02 19:17:36 jtc Exp $
* $Header: /cvsroot/src/usr.bin/lex/Attic/flex.skl,v 1.2 1993/12/06 19:29:11 jtc Exp $
*/
#define FLEX_SCANNER
%-
#include <stdio.h>
%*
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
@ -21,7 +23,7 @@
#include <stdlib.h>
%+
#include <iostream.h>
class istream;
%*
#include <unistd.h>
@ -101,6 +103,7 @@ extern "C" {
extern void *yy_flex_realloc YY_PROTO(( void *ptr, int size ));
extern void yy_flex_free YY_PROTO(( void * ));
extern int yywrap YY_PROTO(( void ));
extern void yy_strcpy YY_PROTO(( char *s1, const char *s2 ));
#ifdef __cplusplus
}
#endif
@ -1000,7 +1003,7 @@ char msg[];
#endif
{
%-
(void) putc( '\n', stderr );
(void) fprintf( stderr, "%s\n", msg );
%+
cerr << msg << '\n';
%*

View File

@ -26,10 +26,9 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* @(#) $Header: /cvsroot/src/usr.bin/lex/Attic/flexdef.h,v 1.5 1993/12/02 19:17:37 jtc Exp $ (LBL) */
/* @(#) $Header: /cvsroot/src/usr.bin/lex/Attic/flexdef.h,v 1.6 1993/12/06 19:29:13 jtc Exp $ (LBL) */
#include <stdio.h>
#include <string.h>
#include <ctype.h>
/* Always be prepared to generate an 8-bit scanner. */
@ -549,7 +548,7 @@ extern char **scname;
extern int current_max_dfa_size, current_max_xpairs;
extern int current_max_template_xpairs, current_max_dfas;
extern int lastdfa, lasttemp, *nxt, *chk, *tnxt;
extern int lastdfa, *nxt, *chk, *tnxt;
extern int *base, *def, *nultrans, NUL_ec, tblend, firstfree, **dss, *dfasiz;
extern union dfaacc_union
{
@ -608,7 +607,9 @@ void *reallocate_array PROTO((void*, int, int));
void *yy_flex_alloc PROTO((int));
void *yy_flex_realloc PROTO((void*, int));
void yy_flex_free PROTO((void*));
void *yy_flex_xmalloc PROTO((int));
int yy_strcmp PROTO(( const char *s1, const char *s2 ));
void yy_strcpy PROTO(( char *s1, const char *s2 ));
int yy_strlen PROTO(( const char *s ));
#define allocate_integer_array(size) \
(int *) allocate_array( size, sizeof( int ) )
@ -767,6 +768,9 @@ extern void skelout PROTO((void));
/* Output a yy_trans_info structure. */
extern void transition_struct_out PROTO((int, int));
/* Only needed when using certain broken versions of bison to build parse.c. */
extern void *yy_flex_xmalloc PROTO(( int ));
/* Set a region of memory to 0. */
extern void zero_out PROTO((char *, int));

View File

@ -1715,7 +1715,8 @@ to detect the keywords, you're better off using
.IP
This option is equivalent to
.B \-CFr
(see below).
(see below). It cannot be used with
.B \-+.
.TP
.B \-I
instructs
@ -1905,7 +1906,8 @@ specifies that the alternate fast scanner representation (described
above under the
.B \-F
flag)
should be used.
should be used. This option cannot be used with
.B \-+.
.IP
.B \-Cm
directs
@ -2855,10 +2857,9 @@ scanner complaining about the following missing routines:
.ds
yywrap
yy_flex_alloc
yy_flex_realloc
yy_flex_free
...
.de
then you forgot to link your program with
(and various others) then you forgot to link your program with
.B \-lfl.
This run-time library is
.I required
@ -3001,20 +3002,23 @@ Casey Leedom,
Nelson H.F. Beebe, benson@odi.com, Peter A. Bigot, Keith Bostic, Frederic
Brehm, Nick Christopher, Jason Coughlin, Bill Cox, Dave Curtis, Scott David
Daniels, Chris G. Demetriou, Mike Donahue, Chuck Doucette, Tom Epperly, Leo
Eskin, Chris Faylor, Jon Forrest, Eric Goldman, Ulrich Grepel, Jan Hajic,
Jarkko Hietaniemi, Eric Hughes, Ceriel Jacobs, Jeffrey R. Jones, Henry
Eskin, Chris Faylor, Jon Forrest, Kaveh R. Ghazi,
Eric Goldman, Ulrich Grepel, Jan Hajic,
Jarkko Hietaniemi, Eric Hughes, John Interrante,
Ceriel Jacobs, Jeffrey R. Jones, Henry
Juengst, Amir Katz, ken@ken.hilco.com, Kevin B. Kenny, Marq Kole, Ronald
Lamprecht, Greg Lee, Craig Leres, John Levine, Mohamed el Lozy, Chris
Metcalf, Luke Mewburn, Jim Meyering, G.T. Nicol, Landon Noll, Marc Nozell,
Richard Ohnemus, Sven Panne, Roland Pesch, Walter Pelissero, Gaumond
Pierre, Esmond Pitt, Jef Poskanzer, Kevin Rodgers, Jim
Pierre, Esmond Pitt, Jef Poskanzer, Joe Rahmeh, Kevin Rodgers, Jim
Roskind, Doug Schmidt, Alex Siegel, Paul Stuart, Dave Tallman, Paul
Tuinenga, Gary Weik, Frank Whaley, Gerhard Wilhelms, Kent Williams, Ken
Yap, Nathan Zelle, David Zuhn, and those whose names have slipped my marginal
mail-archiving skills but whose contributions are appreciated all the
same.
.PP
Thanks to Keith Bostic, John Gilmore, Craig Leres, Bob Mulcahy, G.T.
Thanks to Keith Bostic, Noah Friedman,
John Gilmore, Craig Leres, Bob Mulcahy, G.T.
Nicol, Francois Pinard, Rich Salz, and Richard Stallman for help with various
distribution headaches.
.PP

View File

@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header: /cvsroot/src/usr.bin/lex/Attic/gen.c,v 1.4 1993/12/02 19:17:43 jtc Exp $ */
/* $Header: /cvsroot/src/usr.bin/lex/Attic/gen.c,v 1.5 1993/12/06 19:29:19 jtc Exp $ */
#include "flexdef.h"
@ -594,7 +594,7 @@ int worry_about_NULs;
}
else
(void) strcpy( char_map,
yy_strcpy( char_map,
useecs ? "yy_ec[(unsigned int) *yy_cp]" : "*yy_cp" );
if ( worry_about_NULs && nultrans )
@ -1052,7 +1052,7 @@ void make_tables()
indent_puts(
"YY_FATAL_ERROR( \"token too large, exceeds YYLMAX\" ); \\" );
indent_down();
indent_puts( "strcpy( yytext, yytext_ptr ); \\" );
indent_puts( "yy_strcpy( yytext, yytext_ptr ); \\" );
}
set_indent( 0 );
@ -1255,7 +1255,7 @@ void make_tables()
printf(
"\tif ( yy_current_buffer->is_interactive ) \\\n" );
printf(
"\t\tresult = (buf[0] = getc( yyin )) == EOF ? 0 : 1; \\\n" );
"\t\tresult = ((int) (buf[0] = getc( yyin ))) == EOF ? 0 : 1; \\\n" );
printf(
"\telse if ( ((result = fread( (char *) buf, 1, max_size, yyin )) == 0)\\\n" );
printf( "\t\t && ferror( yyin ) ) \\\n" );

View File

@ -1,7 +1,7 @@
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
* $Header: /cvsroot/src/usr.bin/lex/Attic/initscan.c,v 1.4 1993/12/02 19:17:46 jtc Exp $
* $Header: /cvsroot/src/usr.bin/lex/Attic/initscan.c,v 1.5 1993/12/06 19:29:22 jtc Exp $
*/
#define FLEX_SCANNER
@ -96,6 +96,7 @@ extern "C" {
extern void *yy_flex_realloc YY_PROTO(( void *ptr, int size ));
extern void yy_flex_free YY_PROTO(( void * ));
extern int yywrap YY_PROTO(( void ));
extern void yy_strcpy YY_PROTO(( char *s1, const char *s2 ));
#ifdef __cplusplus
}
#endif
@ -866,7 +867,7 @@ char *yytext;
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header: /cvsroot/src/usr.bin/lex/Attic/initscan.c,v 1.4 1993/12/02 19:17:46 jtc Exp $ */
/* $Header: /cvsroot/src/usr.bin/lex/Attic/initscan.c,v 1.5 1993/12/06 19:29:22 jtc Exp $ */
#include "flexdef.h"
#include "parse.h"
@ -882,11 +883,11 @@ char *yytext;
return CHAR;
#define RETURNNAME \
(void) strcpy( nmstr, yytext ); \
yy_strcpy( nmstr, yytext ); \
return NAME;
#define PUT_BACK_STRING(str, start) \
for ( i = strlen( str ) - 1; i >= start; --i ) \
for ( i = yy_strlen( str ) - 1; i >= start; --i ) \
unput((str)[i])
#define CHECK_REJECT(str) \
@ -921,7 +922,7 @@ char *yytext;
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
if ( yy_current_buffer->is_interactive ) \
result = (buf[0] = getc( yyin )) == EOF ? 0 : 1; \
result = ((int) (buf[0] = getc( yyin ))) == EOF ? 0 : 1; \
else if ( ((result = fread( (char *) buf, 1, max_size, yyin )) == 0)\
&& ferror( yyin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" );
@ -1139,7 +1140,7 @@ synerr( "unrecognized '%' directive" );
case 14:
# line 141 "scan.l"
{
(void) strcpy( nmstr, yytext );
yy_strcpy( nmstr, yytext );
didadef = false;
BEGIN(PICKUPDEF);
}
@ -1208,10 +1209,10 @@ case 28:
case 29:
# line 173 "scan.l"
{
(void) strcpy( (char *) nmdef, yytext );
yy_strcpy( (char *) nmdef, yytext );
/* Skip trailing whitespace. */
for ( i = strlen( (char *) nmdef ) - 1;
for ( i = yy_strlen( (char *) nmdef ) - 1;
i >= 0 && (nmdef[i] == ' ' || nmdef[i] == '\t');
--i )
;
@ -1407,7 +1408,7 @@ case 57:
{
int cclval;
(void) strcpy( nmstr, yytext );
yy_strcpy( nmstr, yytext );
/* Check to see if we've already encountered this
* ccl.
@ -1444,7 +1445,7 @@ case 58:
register Char *nmdefptr;
Char *ndlookup();
(void) strcpy( nmstr, yytext + 1 );
yy_strcpy( nmstr, yytext + 1 );
nmstr[yyleng - 2] = '\0'; /* chop trailing brace */
if ( ! (nmdefptr = ndlookup( nmstr )) )
@ -1453,7 +1454,7 @@ case 58:
else
{ /* push back name surrounded by ()'s */
int len = strlen( (char *) nmdefptr );
int len = yy_strlen( (char *) nmdefptr );
if ( lex_compat || nmdefptr[0] == '^' ||
(len > 0 && nmdefptr[len - 1] == '$') )
@ -2344,7 +2345,7 @@ static void yy_fatal_error( msg )
char msg[];
#endif
{
(void) putc( '\n', stderr );
(void) fprintf( stderr, "%s\n", msg );
exit( 1 );
}

View File

@ -32,7 +32,7 @@ char copyright[] =
All rights reserved.\n";
#endif /* not lint */
/* $Header: /cvsroot/src/usr.bin/lex/Attic/main.c,v 1.4 1993/12/02 19:17:50 jtc Exp $ */
/* $Header: /cvsroot/src/usr.bin/lex/Attic/main.c,v 1.5 1993/12/06 19:29:25 jtc Exp $ */
#include "flexdef.h"
@ -315,7 +315,7 @@ int exit_status;
if ( skelname )
fprintf( stderr, " -S%s", skelname );
if ( strcmp( prefix, "yy" ) )
if ( yy_strcmp( prefix, "yy" ) )
fprintf( stderr, " -P%s", prefix );
putc( '\n', stderr );
@ -449,7 +449,7 @@ char **argv;
program_name = argv[0];
if ( program_name[0] != '\0' &&
program_name[strlen( program_name ) - 1] == '+' )
program_name[yy_strlen( program_name ) - 1] == '+' )
C_plus_plus = true;
/* read flags */
@ -677,13 +677,16 @@ char **argv;
}
if ( (fulltbl || fullspd) && usemecs )
flexerror( "-f/-F and -Cm don't make sense together" );
flexerror( "-Cf/-CF and -Cm don't make sense together" );
if ( (fulltbl || fullspd) && interactive )
flexerror( "-f/-F and -I are incompatible" );
flexerror( "-Cf/-CF and -I are incompatible" );
if ( fulltbl && fullspd )
flexerror( "-f and -F are mutually exclusive" );
flexerror( "-Cf and -CF are mutually exclusive" );
if ( C_plus_plus && fullspd )
flexerror( "Can't use -+ with -CF option" );
if ( ! use_stdout )
{
@ -731,7 +734,7 @@ char **argv;
if ( skelname && (skelfile = fopen( skelname, "r" )) == NULL )
lerrsf( "can't open skeleton file %s", skelname );
if ( strcmp( prefix, "yy" ) )
if ( yy_strcmp( prefix, "yy" ) )
{
#define GEN_PREFIX(name) printf( "#define yy%s %s%s\n", name, prefix, name );
GEN_PREFIX( "FlexLexer" );
@ -830,7 +833,7 @@ void readin()
if ( fullspd )
printf(
"typedef const struct yy_trans_info *yy_state_type;\n" );
else
else if ( ! C_plus_plus )
printf( "typedef int yy_state_type;\n" );
if ( reject )
@ -845,7 +848,7 @@ void readin()
printf( "extern int yylineno;\n" );
printf( "int yylineno = 1;\n" );
}
else
else if ( ! C_plus_plus )
printf( "FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;\n" );
if ( C_plus_plus )
@ -854,10 +857,7 @@ void readin()
else
{
if ( yytext_is_array )
{
puts( "\n#include <string.h>\n" );
puts( "extern char yytext[];\n" );
}
else
{

View File

@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header: /cvsroot/src/usr.bin/lex/Attic/misc.c,v 1.4 1993/12/02 19:17:51 jtc Exp $ */
/* $Header: /cvsroot/src/usr.bin/lex/Attic/misc.c,v 1.5 1993/12/06 19:29:27 jtc Exp $ */
#include "flexdef.h"
@ -41,7 +41,7 @@ int otoi PROTO((Char []));
void add_action( new_text )
char *new_text;
{
int len = strlen( new_text );
int len = yy_strlen( new_text );
while ( len + action_index >= action_size - 10 /* slop */ )
{
@ -50,7 +50,7 @@ char *new_text;
reallocate_character_array( action_array, action_size );
}
strcpy( &action_array[action_index], new_text );
yy_strcpy( &action_array[action_index], new_text );
action_index += len;
}
@ -501,7 +501,6 @@ Char myesc( array )
Char array[];
{
Char c, esc_char;
register int sptr;
switch ( array[1] )
{
@ -530,7 +529,7 @@ Char array[];
case '8':
case '9':
{ /* \<octal> */
sptr = 1;
int sptr = 1;
while ( isascii( array[sptr] ) &&
isdigit( array[sptr] ) )
@ -740,6 +739,21 @@ int element_v, element_n;
}
/* The following is only needed when building flex's parser using certain
* broken versions of bison.
*/
void *yy_flex_xmalloc( size )
int size;
{
void *result = yy_flex_alloc( size );
if ( ! result )
flexfatal( "memory allocation failed in yy_flex_xmalloc()" );
return result;
}
/* zero_out - set a region of memory to 0
*
* Sets region_ptr[0] through region_ptr[size_in_bytes - 1] to zero.

View File

@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header: /cvsroot/src/usr.bin/lex/Attic/nfa.c,v 1.4 1993/12/02 19:17:54 jtc Exp $ */
/* $Header: /cvsroot/src/usr.bin/lex/Attic/nfa.c,v 1.5 1993/12/06 19:29:29 jtc Exp $ */
#include "flexdef.h"

View File

@ -29,7 +29,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header: /cvsroot/src/usr.bin/lex/Attic/parse.y,v 1.4 1993/12/02 19:17:56 jtc Exp $ */
/* $Header: /cvsroot/src/usr.bin/lex/Attic/parse.y,v 1.5 1993/12/06 19:29:30 jtc Exp $ */
/* Some versions of bison are broken in that they use alloca() but don't

View File

@ -27,7 +27,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header: /cvsroot/src/usr.bin/lex/Attic/scan.l,v 1.4 1993/12/02 19:17:59 jtc Exp $ */
/* $Header: /cvsroot/src/usr.bin/lex/Attic/scan.l,v 1.5 1993/12/06 19:29:31 jtc Exp $ */
#include "flexdef.h"
#include "parse.h"
@ -43,11 +43,11 @@
return CHAR;
#define RETURNNAME \
(void) strcpy( nmstr, yytext ); \
yy_strcpy( nmstr, yytext ); \
return NAME;
#define PUT_BACK_STRING(str, start) \
for ( i = strlen( str ) - 1; i >= start; --i ) \
for ( i = yy_strlen( str ) - 1; i >= start; --i ) \
unput((str)[i])
#define CHECK_REJECT(str) \
@ -139,7 +139,7 @@ CCL_CHAR ([^\\\n\]]|{ESCSEQ})
^"%"[^sxanpekotcru{}].* synerr( "unrecognized '%' directive" );
^{NAME} {
(void) strcpy( nmstr, yytext );
yy_strcpy( nmstr, yytext );
didadef = false;
BEGIN(PICKUPDEF);
}
@ -171,10 +171,10 @@ CCL_CHAR ([^\\\n\]]|{ESCSEQ})
<PICKUPDEF>{WS} /* separates name and definition */
<PICKUPDEF>{NOT_WS}.* {
(void) strcpy( (char *) nmdef, yytext );
yy_strcpy( (char *) nmdef, yytext );
/* Skip trailing whitespace. */
for ( i = strlen( (char *) nmdef ) - 1;
for ( i = yy_strlen( (char *) nmdef ) - 1;
i >= 0 && (nmdef[i] == ' ' || nmdef[i] == '\t');
--i )
;
@ -296,7 +296,7 @@ CCL_CHAR ([^\\\n\]]|{ESCSEQ})
<SECT2>"["{FIRST_CCL_CHAR}{CCL_CHAR}* {
int cclval;
(void) strcpy( nmstr, yytext );
yy_strcpy( nmstr, yytext );
/* Check to see if we've already encountered this
* ccl.
@ -331,7 +331,7 @@ CCL_CHAR ([^\\\n\]]|{ESCSEQ})
register Char *nmdefptr;
Char *ndlookup();
(void) strcpy( nmstr, yytext + 1 );
yy_strcpy( nmstr, yytext + 1 );
nmstr[yyleng - 2] = '\0'; /* chop trailing brace */
if ( ! (nmdefptr = ndlookup( nmstr )) )
@ -340,7 +340,7 @@ CCL_CHAR ([^\\\n\]]|{ESCSEQ})
else
{ /* push back name surrounded by ()'s */
int len = strlen( (char *) nmdefptr );
int len = yy_strlen( (char *) nmdefptr );
if ( lex_compat || nmdefptr[0] == '^' ||
(len > 0 && nmdefptr[len - 1] == '$') )

View File

@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header: /cvsroot/src/usr.bin/lex/Attic/sym.c,v 1.4 1993/12/02 19:18:00 jtc Exp $ */
/* $Header: /cvsroot/src/usr.bin/lex/Attic/sym.c,v 1.5 1993/12/06 19:29:33 jtc Exp $ */
#include "flexdef.h"
@ -62,7 +62,7 @@ int table_size;
while ( sym_entry )
{
if ( ! strcmp( sym, sym_entry->name ) )
if ( ! yy_strcmp( sym, sym_entry->name ) )
{ /* entry already exists */
return -1;
}
@ -134,14 +134,15 @@ int table_size;
{
static struct hash_entry empty_entry =
{
(struct hash_entry *) 0, (struct hash_entry *) 0, NULL, NULL, 0,
(struct hash_entry *) 0, (struct hash_entry *) 0,
(char *) 0, (char *) 0, 0,
} ;
register struct hash_entry *sym_entry =
table[hashfunct( sym, table_size )];
while ( sym_entry )
{
if ( ! strcmp( sym, sym_entry->name ) )
if ( ! yy_strcmp( sym, sym_entry->name ) )
return sym_entry;
sym_entry = sym_entry->next;
}
@ -174,14 +175,15 @@ int hash_size;
/* ndinstal - install a name definition */
void ndinstal( nd, def )
char nd[];
Char def[];
void ndinstal( name, definition )
char name[];
Char definition[];
{
char *copy_string();
Char *copy_unsigned_string();
if ( addsym( copy_string( nd ), (char *) copy_unsigned_string( def ), 0,
if ( addsym( copy_string( name ),
(char *) copy_unsigned_string( definition ), 0,
ndtbl, NAME_TABLE_HASH_SIZE ) )
synerr( "name defined twice" );
}

View File

@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header: /cvsroot/src/usr.bin/lex/Attic/tblcmp.c,v 1.4 1993/12/02 19:18:02 jtc Exp $ */
/* $Header: /cvsroot/src/usr.bin/lex/Attic/tblcmp.c,v 1.5 1993/12/06 19:29:35 jtc Exp $ */
#include "flexdef.h"

View File

@ -1 +1 @@
#define FLEX_VERSION "2.4.2"
#define FLEX_VERSION "2.4.3"

View File

@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header: /cvsroot/src/usr.bin/lex/Attic/yylex.c,v 1.4 1993/12/02 19:18:05 jtc Exp $ */
/* $Header: /cvsroot/src/usr.bin/lex/Attic/yylex.c,v 1.5 1993/12/06 19:29:38 jtc Exp $ */
#include <ctype.h>
#include "flexdef.h"