Upgrade to version 2.4.6
This commit is contained in:
parent
27876f2d51
commit
7340d816d0
@ -770,7 +770,11 @@ each rule's action from the following rule's.
|
||||
.SH FILES
|
||||
.TP
|
||||
.B \-lfl
|
||||
library with which scanners must be linked.
|
||||
library with which to link scanners to obtain the default versions
|
||||
of
|
||||
.I yywrap()
|
||||
and/or
|
||||
.I main().
|
||||
.TP
|
||||
.I lex.yy.c
|
||||
generated scanner (called
|
||||
@ -804,16 +808,6 @@ flexdoc(1), lex(1), yacc(1), sed(1), awk(1).
|
||||
M. E. Lesk and E. Schmidt,
|
||||
.I LEX \- Lexical Analyzer Generator
|
||||
.SH DIAGNOSTICS
|
||||
If you receive errors when linking a
|
||||
.I flex
|
||||
scanner complaining about the following missing routines:
|
||||
.ds
|
||||
yywrap
|
||||
yy_flex_alloc
|
||||
...
|
||||
.de
|
||||
(and various others) then you forgot to link your program with
|
||||
.B \-lfl.
|
||||
.PP
|
||||
.I reject_used_but_not_detected undefined
|
||||
or
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* A lexical scanner generated by flex */
|
||||
|
||||
/* Scanner skeleton version:
|
||||
* $Header: /cvsroot/src/usr.bin/lex/Attic/flex.skl,v 1.4 1993/12/14 02:09:55 jtc Exp $
|
||||
* $Header: /cvsroot/src/usr.bin/lex/Attic/flex.skl,v 1.5 1994/01/06 23:58:24 jtc Exp $
|
||||
*/
|
||||
|
||||
#define FLEX_SCANNER
|
||||
@ -106,11 +106,7 @@ extern FILE *yyin, *yyout;
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
extern void *yy_flex_alloc YY_PROTO(( int ));
|
||||
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
|
||||
@ -230,8 +226,23 @@ void yy_load_buffer_state YY_PROTO(( void ));
|
||||
YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
|
||||
void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
|
||||
void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
|
||||
|
||||
static int yy_start_stack_ptr = 0;
|
||||
static int yy_start_stack_depth = 0;
|
||||
static int *yy_start_stack = 0;
|
||||
static void yy_push_state YY_PROTO(( int new_state ));
|
||||
static void yy_pop_state YY_PROTO(( void ));
|
||||
static int yy_top_state YY_PROTO(( void ));
|
||||
%*
|
||||
|
||||
#ifndef yytext_ptr
|
||||
static void yy_flex_strcpy YY_PROTO(( char *, const char * ));
|
||||
#endif
|
||||
|
||||
static void *yy_flex_alloc YY_PROTO(( unsigned int ));
|
||||
static void *yy_flex_realloc YY_PROTO(( void *ptr, unsigned int ));
|
||||
static void yy_flex_free YY_PROTO(( void * ));
|
||||
|
||||
#define yy_new_buffer yy_create_buffer
|
||||
|
||||
%% yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here
|
||||
@ -248,8 +259,8 @@ static int input YY_PROTO(( void ));
|
||||
static yy_state_type yy_get_previous_state YY_PROTO(( void ));
|
||||
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
|
||||
static int yy_get_next_buffer YY_PROTO(( void ));
|
||||
%*
|
||||
static void yy_fatal_error YY_PROTO(( const char msg[] ));
|
||||
%*
|
||||
|
||||
/* Done after the current pattern has been matched and before the
|
||||
* corresponding action - sets up yytext.
|
||||
@ -268,6 +279,21 @@ static void yy_fatal_error YY_PROTO(( const char msg[] ));
|
||||
* section 1.
|
||||
*/
|
||||
|
||||
#ifdef YY_MALLOC_DECL
|
||||
YY_MALLOC_DECL
|
||||
#else
|
||||
#if __STDC__
|
||||
#ifndef __cplusplus
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#else
|
||||
/* Just try to get by without declaring the routines. This will fail
|
||||
* miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
|
||||
* or sizeof(void*) != sizeof(int).
|
||||
*/
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Amount of stuff to slurp up with each read. */
|
||||
#ifndef YY_READ_BUF_SIZE
|
||||
#define YY_READ_BUF_SIZE 8192
|
||||
@ -306,6 +332,11 @@ static void yy_fatal_error YY_PROTO(( const char msg[] ));
|
||||
#define yyterminate() return YY_NULL
|
||||
#endif
|
||||
|
||||
/* Number of entries by which start-condition stack grows. */
|
||||
#ifndef YY_START_STACK_INCR
|
||||
#define YY_START_STACK_INCR 25
|
||||
#endif
|
||||
|
||||
/* Report a fatal error. */
|
||||
#ifndef YY_FATAL_ERROR
|
||||
%-
|
||||
@ -1039,6 +1070,65 @@ void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, istream* file )
|
||||
}
|
||||
|
||||
|
||||
%-
|
||||
#ifdef YY_USE_PROTOS
|
||||
static void yy_push_state( int new_state )
|
||||
#else
|
||||
static void yy_push_state( new_state )
|
||||
int new_state;
|
||||
#endif
|
||||
%+
|
||||
void yyFlexLexer::yy_push_state( int new_state )
|
||||
%*
|
||||
{
|
||||
if ( yy_start_stack_ptr >= yy_start_stack_depth )
|
||||
{
|
||||
int new_size;
|
||||
|
||||
yy_start_stack_depth += YY_START_STACK_INCR;
|
||||
new_size = yy_start_stack_depth * sizeof( int );
|
||||
|
||||
if ( ! yy_start_stack )
|
||||
yy_start_stack = (int *) yy_flex_alloc( new_size );
|
||||
|
||||
else
|
||||
yy_start_stack = (int *) yy_flex_realloc(
|
||||
(void *) yy_start_stack, new_size );
|
||||
|
||||
if ( ! yy_start_stack )
|
||||
YY_FATAL_ERROR(
|
||||
"out of memory expanding start-condition stack" );
|
||||
}
|
||||
|
||||
yy_start_stack[yy_start_stack_ptr++] = YY_START;
|
||||
|
||||
BEGIN(new_state);
|
||||
}
|
||||
|
||||
|
||||
%-
|
||||
static void yy_pop_state()
|
||||
%+
|
||||
void yyFlexLexer::yy_pop_state()
|
||||
%*
|
||||
{
|
||||
if ( --yy_start_stack_ptr < 0 )
|
||||
YY_FATAL_ERROR( "start-condition stack underflow" );
|
||||
|
||||
BEGIN(yy_start_stack[yy_start_stack_ptr]);
|
||||
}
|
||||
|
||||
|
||||
%-
|
||||
static int yy_top_state()
|
||||
%+
|
||||
int yyFlexLexer::yy_top_state()
|
||||
%*
|
||||
{
|
||||
return yy_start_stack[yy_start_stack_ptr - 1];
|
||||
}
|
||||
|
||||
|
||||
%-
|
||||
#ifdef YY_USE_PROTOS
|
||||
static void yy_fatal_error( const char msg[] )
|
||||
@ -1075,3 +1165,52 @@ void yyFlexLexer::LexerError( const char msg[] )
|
||||
yyleng = n; \
|
||||
} \
|
||||
while ( 0 )
|
||||
|
||||
|
||||
/* Internal utility routines. */
|
||||
|
||||
#ifndef yytext_ptr
|
||||
#ifdef YY_USE_PROTOS
|
||||
static void yy_flex_strcpy( char *s1, const char *s2 )
|
||||
#else
|
||||
static void yy_flex_strcpy( s1, s2 )
|
||||
char *s1;
|
||||
const char *s2;
|
||||
#endif
|
||||
{
|
||||
while ( (*(s1++) = *(s2++)) )
|
||||
;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef YY_USE_PROTOS
|
||||
static void *yy_flex_alloc( unsigned int size )
|
||||
#else
|
||||
static void *yy_flex_alloc( size )
|
||||
unsigned int size;
|
||||
#endif
|
||||
{
|
||||
return (void *) malloc( size );
|
||||
}
|
||||
|
||||
#ifdef YY_USE_PROTOS
|
||||
static void *yy_flex_realloc( void *ptr, unsigned int size )
|
||||
#else
|
||||
static void *yy_flex_realloc( ptr, size )
|
||||
void *ptr;
|
||||
unsigned int size;
|
||||
#endif
|
||||
{
|
||||
return (void *) realloc( ptr, size );
|
||||
}
|
||||
|
||||
#ifdef YY_USE_PROTOS
|
||||
static void yy_flex_free( void *ptr )
|
||||
#else
|
||||
static void yy_flex_free( ptr )
|
||||
void *ptr;
|
||||
#endif
|
||||
{
|
||||
free( ptr );
|
||||
}
|
||||
|
@ -26,11 +26,21 @@
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
/* @(#) $Header: /cvsroot/src/usr.bin/lex/Attic/flexdef.h,v 1.7 1993/12/09 19:06:10 jtc Exp $ (LBL) */
|
||||
/* @(#) $Header: /cvsroot/src/usr.bin/lex/Attic/flexdef.h,v 1.8 1994/01/06 23:58:26 jtc Exp $ (LBL) */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#if HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#else
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#if __STDC__
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
/* Always be prepared to generate an 8-bit scanner. */
|
||||
#define CSIZE 256
|
||||
#define Char unsigned char
|
||||
@ -604,12 +614,9 @@ extern int num_backing_up, bol_needed;
|
||||
void *allocate_array PROTO((int, int));
|
||||
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*));
|
||||
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 ));
|
||||
void *flex_alloc PROTO((unsigned int));
|
||||
void *flex_realloc PROTO((void*, unsigned int));
|
||||
void flex_free PROTO((void*));
|
||||
|
||||
#define allocate_integer_array(size) \
|
||||
(int *) allocate_array( size, sizeof( int ) )
|
||||
|
@ -2861,21 +2861,6 @@ is (rather surprisingly) truncated to
|
||||
does not truncate the action. Actions that are not enclosed in
|
||||
braces are simply terminated at the end of the line.
|
||||
.SH DIAGNOSTICS
|
||||
If you receive errors when linking a
|
||||
.I flex
|
||||
scanner complaining about the following missing routines:
|
||||
.ds
|
||||
yywrap
|
||||
yy_flex_alloc
|
||||
...
|
||||
.de
|
||||
(and various others) then you forgot to link your program with
|
||||
.B \-lfl.
|
||||
This run-time library is
|
||||
.I required
|
||||
for all
|
||||
.I flex
|
||||
scanners.
|
||||
.PP
|
||||
.I warning, rule cannot be matched
|
||||
indicates that the given rule
|
||||
|
@ -26,7 +26,7 @@
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
/* $Header: /cvsroot/src/usr.bin/lex/Attic/gen.c,v 1.7 1993/12/14 02:10:07 jtc Exp $ */
|
||||
/* $Header: /cvsroot/src/usr.bin/lex/Attic/gen.c,v 1.8 1994/01/06 23:58:33 jtc Exp $ */
|
||||
|
||||
#include "flexdef.h"
|
||||
|
||||
@ -597,9 +597,8 @@ int worry_about_NULs;
|
||||
}
|
||||
|
||||
else
|
||||
yy_strcpy( char_map, useecs ?
|
||||
"yy_ec[YY_SC_TO_UI(*yy_cp)]" :
|
||||
"YY_SC_TO_UI(*yy_cp)" );
|
||||
strcpy( char_map, useecs ? "yy_ec[YY_SC_TO_UI(*yy_cp)]" :
|
||||
"YY_SC_TO_UI(*yy_cp)" );
|
||||
|
||||
if ( worry_about_NULs && nultrans )
|
||||
{
|
||||
@ -1056,7 +1055,7 @@ void make_tables()
|
||||
indent_puts(
|
||||
"YY_FATAL_ERROR( \"token too large, exceeds YYLMAX\" ); \\" );
|
||||
indent_down();
|
||||
indent_puts( "yy_strcpy( yytext, yytext_ptr ); \\" );
|
||||
indent_puts( "yy_flex_strcpy( yytext, yytext_ptr ); \\" );
|
||||
}
|
||||
|
||||
set_indent( 0 );
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* A lexical scanner generated by flex */
|
||||
|
||||
/* Scanner skeleton version:
|
||||
* $Header: /cvsroot/src/usr.bin/lex/Attic/initscan.c,v 1.7 1993/12/14 02:10:10 jtc Exp $
|
||||
* $Header: /cvsroot/src/usr.bin/lex/Attic/initscan.c,v 1.8 1994/01/06 23:58:40 jtc Exp $
|
||||
*/
|
||||
|
||||
#define FLEX_SCANNER
|
||||
@ -99,11 +99,7 @@ extern FILE *yyin, *yyout;
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
extern void *yy_flex_alloc YY_PROTO(( int ));
|
||||
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
|
||||
@ -217,6 +213,21 @@ YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
|
||||
void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
|
||||
void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
|
||||
|
||||
static int yy_start_stack_ptr = 0;
|
||||
static int yy_start_stack_depth = 0;
|
||||
static int *yy_start_stack = 0;
|
||||
static void yy_push_state YY_PROTO(( int new_state ));
|
||||
static void yy_pop_state YY_PROTO(( void ));
|
||||
static int yy_top_state YY_PROTO(( void ));
|
||||
|
||||
#ifndef yytext_ptr
|
||||
static void yy_flex_strcpy YY_PROTO(( char *, const char * ));
|
||||
#endif
|
||||
|
||||
static void *yy_flex_alloc YY_PROTO(( unsigned int ));
|
||||
static void *yy_flex_realloc YY_PROTO(( void *ptr, unsigned int ));
|
||||
static void yy_flex_free YY_PROTO(( void * ));
|
||||
|
||||
#define yy_new_buffer yy_create_buffer
|
||||
|
||||
#define INITIAL 0
|
||||
@ -879,7 +890,7 @@ char *yytext;
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
/* $Header: /cvsroot/src/usr.bin/lex/Attic/initscan.c,v 1.7 1993/12/14 02:10:10 jtc Exp $ */
|
||||
/* $Header: /cvsroot/src/usr.bin/lex/Attic/initscan.c,v 1.8 1994/01/06 23:58:40 jtc Exp $ */
|
||||
|
||||
#include "flexdef.h"
|
||||
#include "parse.h"
|
||||
@ -895,11 +906,11 @@ char *yytext;
|
||||
return CHAR;
|
||||
|
||||
#define RETURNNAME \
|
||||
yy_strcpy( nmstr, yytext ); \
|
||||
strcpy( nmstr, yytext ); \
|
||||
return NAME;
|
||||
|
||||
#define PUT_BACK_STRING(str, start) \
|
||||
for ( i = yy_strlen( str ) - 1; i >= start; --i ) \
|
||||
for ( i = strlen( str ) - 1; i >= start; --i ) \
|
||||
unput((str)[i])
|
||||
|
||||
#define CHECK_REJECT(str) \
|
||||
@ -914,6 +925,21 @@ char *yytext;
|
||||
* section 1.
|
||||
*/
|
||||
|
||||
#ifdef YY_MALLOC_DECL
|
||||
YY_MALLOC_DECL
|
||||
#else
|
||||
#if __STDC__
|
||||
#ifndef __cplusplus
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#else
|
||||
/* Just try to get by without declaring the routines. This will fail
|
||||
* miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
|
||||
* or sizeof(void*) != sizeof(int).
|
||||
*/
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Amount of stuff to slurp up with each read. */
|
||||
#ifndef YY_READ_BUF_SIZE
|
||||
#define YY_READ_BUF_SIZE 8192
|
||||
@ -952,6 +978,11 @@ char *yytext;
|
||||
#define yyterminate() return YY_NULL
|
||||
#endif
|
||||
|
||||
/* Number of entries by which start-condition stack grows. */
|
||||
#ifndef YY_START_STACK_INCR
|
||||
#define YY_START_STACK_INCR 25
|
||||
#endif
|
||||
|
||||
/* Report a fatal error. */
|
||||
#ifndef YY_FATAL_ERROR
|
||||
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
|
||||
@ -1170,7 +1201,7 @@ case 14:
|
||||
YY_USER_ACTION
|
||||
# line 141 "scan.l"
|
||||
{
|
||||
yy_strcpy( nmstr, yytext );
|
||||
strcpy( nmstr, yytext );
|
||||
didadef = false;
|
||||
BEGIN(PICKUPDEF);
|
||||
}
|
||||
@ -1254,10 +1285,10 @@ case 29:
|
||||
YY_USER_ACTION
|
||||
# line 173 "scan.l"
|
||||
{
|
||||
yy_strcpy( (char *) nmdef, yytext );
|
||||
strcpy( (char *) nmdef, yytext );
|
||||
|
||||
/* Skip trailing whitespace. */
|
||||
for ( i = yy_strlen( (char *) nmdef ) - 1;
|
||||
for ( i = strlen( (char *) nmdef ) - 1;
|
||||
i >= 0 && (nmdef[i] == ' ' || nmdef[i] == '\t');
|
||||
--i )
|
||||
;
|
||||
@ -1481,7 +1512,7 @@ YY_USER_ACTION
|
||||
{
|
||||
int cclval;
|
||||
|
||||
yy_strcpy( nmstr, yytext );
|
||||
strcpy( nmstr, yytext );
|
||||
|
||||
/* Check to see if we've already encountered this
|
||||
* ccl.
|
||||
@ -1519,7 +1550,7 @@ YY_USER_ACTION
|
||||
register Char *nmdefptr;
|
||||
Char *ndlookup();
|
||||
|
||||
yy_strcpy( nmstr, yytext + 1 );
|
||||
strcpy( nmstr, yytext + 1 );
|
||||
nmstr[yyleng - 2] = '\0'; /* chop trailing brace */
|
||||
|
||||
if ( ! (nmdefptr = ndlookup( nmstr )) )
|
||||
@ -1528,7 +1559,7 @@ YY_USER_ACTION
|
||||
|
||||
else
|
||||
{ /* push back name surrounded by ()'s */
|
||||
int len = yy_strlen( (char *) nmdefptr );
|
||||
int len = strlen( (char *) nmdefptr );
|
||||
|
||||
if ( lex_compat || nmdefptr[0] == '^' ||
|
||||
(len > 0 && nmdefptr[len - 1] == '$') )
|
||||
@ -2498,6 +2529,53 @@ FILE *file;
|
||||
}
|
||||
|
||||
|
||||
#ifdef YY_USE_PROTOS
|
||||
static void yy_push_state( int new_state )
|
||||
#else
|
||||
static void yy_push_state( new_state )
|
||||
int new_state;
|
||||
#endif
|
||||
{
|
||||
if ( yy_start_stack_ptr >= yy_start_stack_depth )
|
||||
{
|
||||
int new_size;
|
||||
|
||||
yy_start_stack_depth += YY_START_STACK_INCR;
|
||||
new_size = yy_start_stack_depth * sizeof( int );
|
||||
|
||||
if ( ! yy_start_stack )
|
||||
yy_start_stack = (int *) yy_flex_alloc( new_size );
|
||||
|
||||
else
|
||||
yy_start_stack = (int *) yy_flex_realloc(
|
||||
(void *) yy_start_stack, new_size );
|
||||
|
||||
if ( ! yy_start_stack )
|
||||
YY_FATAL_ERROR(
|
||||
"out of memory expanding start-condition stack" );
|
||||
}
|
||||
|
||||
yy_start_stack[yy_start_stack_ptr++] = YY_START;
|
||||
|
||||
BEGIN(new_state);
|
||||
}
|
||||
|
||||
|
||||
static void yy_pop_state()
|
||||
{
|
||||
if ( --yy_start_stack_ptr < 0 )
|
||||
YY_FATAL_ERROR( "start-condition stack underflow" );
|
||||
|
||||
BEGIN(yy_start_stack[yy_start_stack_ptr]);
|
||||
}
|
||||
|
||||
|
||||
static int yy_top_state()
|
||||
{
|
||||
return yy_start_stack[yy_start_stack_ptr - 1];
|
||||
}
|
||||
|
||||
|
||||
#ifdef YY_USE_PROTOS
|
||||
static void yy_fatal_error( const char msg[] )
|
||||
#else
|
||||
@ -2525,6 +2603,55 @@ char msg[];
|
||||
yyleng = n; \
|
||||
} \
|
||||
while ( 0 )
|
||||
|
||||
|
||||
/* Internal utility routines. */
|
||||
|
||||
#ifndef yytext_ptr
|
||||
#ifdef YY_USE_PROTOS
|
||||
static void yy_flex_strcpy( char *s1, const char *s2 )
|
||||
#else
|
||||
static void yy_flex_strcpy( s1, s2 )
|
||||
char *s1;
|
||||
const char *s2;
|
||||
#endif
|
||||
{
|
||||
while ( (*(s1++) = *(s2++)) )
|
||||
;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef YY_USE_PROTOS
|
||||
static void *yy_flex_alloc( unsigned int size )
|
||||
#else
|
||||
static void *yy_flex_alloc( size )
|
||||
unsigned int size;
|
||||
#endif
|
||||
{
|
||||
return (void *) malloc( size );
|
||||
}
|
||||
|
||||
#ifdef YY_USE_PROTOS
|
||||
static void *yy_flex_realloc( void *ptr, unsigned int size )
|
||||
#else
|
||||
static void *yy_flex_realloc( ptr, size )
|
||||
void *ptr;
|
||||
unsigned int size;
|
||||
#endif
|
||||
{
|
||||
return (void *) realloc( ptr, size );
|
||||
}
|
||||
|
||||
#ifdef YY_USE_PROTOS
|
||||
static void yy_flex_free( void *ptr )
|
||||
#else
|
||||
static void yy_flex_free( ptr )
|
||||
void *ptr;
|
||||
#endif
|
||||
{
|
||||
free( ptr );
|
||||
}
|
||||
# line 515 "scan.l"
|
||||
|
||||
|
||||
@ -2562,3 +2689,25 @@ char *file;
|
||||
infilename = "<stdin>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Wrapper routines for accessing the scanner's malloc routines. */
|
||||
|
||||
void *flex_alloc( size )
|
||||
unsigned int size;
|
||||
{
|
||||
return yy_flex_alloc( size );
|
||||
}
|
||||
|
||||
void *flex_realloc( ptr, size )
|
||||
void *ptr;
|
||||
unsigned int size;
|
||||
{
|
||||
return yy_flex_realloc( ptr, size );
|
||||
}
|
||||
|
||||
void flex_free( ptr )
|
||||
void *ptr;
|
||||
{
|
||||
yy_flex_free( ptr );
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ char copyright[] =
|
||||
All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
/* $Header: /cvsroot/src/usr.bin/lex/Attic/main.c,v 1.7 1993/12/14 02:10:14 jtc Exp $ */
|
||||
/* $Header: /cvsroot/src/usr.bin/lex/Attic/main.c,v 1.8 1994/01/06 23:58:44 jtc Exp $ */
|
||||
|
||||
|
||||
#include "flexdef.h"
|
||||
@ -257,7 +257,7 @@ int exit_status;
|
||||
if ( skelname )
|
||||
fprintf( stderr, " -S%s", skelname );
|
||||
|
||||
if ( yy_strcmp( prefix, "yy" ) )
|
||||
if ( strcmp( prefix, "yy" ) )
|
||||
fprintf( stderr, " -P%s", prefix );
|
||||
|
||||
putc( '\n', stderr );
|
||||
@ -391,7 +391,7 @@ char **argv;
|
||||
program_name = argv[0];
|
||||
|
||||
if ( program_name[0] != '\0' &&
|
||||
program_name[yy_strlen( program_name ) - 1] == '+' )
|
||||
program_name[strlen( program_name ) - 1] == '+' )
|
||||
C_plus_plus = true;
|
||||
|
||||
/* read flags */
|
||||
@ -676,7 +676,7 @@ char **argv;
|
||||
if ( skelname && (skelfile = fopen( skelname, "r" )) == NULL )
|
||||
lerrsf( "can't open skeleton file %s", skelname );
|
||||
|
||||
if ( yy_strcmp( prefix, "yy" ) )
|
||||
if ( strcmp( prefix, "yy" ) )
|
||||
{
|
||||
#define GEN_PREFIX(name) printf( "#define yy%s %s%s\n", name, prefix, name );
|
||||
GEN_PREFIX( "FlexLexer" );
|
||||
|
@ -26,7 +26,7 @@
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
/* $Header: /cvsroot/src/usr.bin/lex/Attic/misc.c,v 1.5 1993/12/06 19:29:27 jtc Exp $ */
|
||||
/* $Header: /cvsroot/src/usr.bin/lex/Attic/misc.c,v 1.6 1994/01/06 23:58:47 jtc Exp $ */
|
||||
|
||||
#include "flexdef.h"
|
||||
|
||||
@ -41,7 +41,7 @@ int otoi PROTO((Char []));
|
||||
void add_action( new_text )
|
||||
char *new_text;
|
||||
{
|
||||
int len = yy_strlen( new_text );
|
||||
int len = 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 );
|
||||
}
|
||||
|
||||
yy_strcpy( &action_array[action_index], new_text );
|
||||
strcpy( &action_array[action_index], new_text );
|
||||
|
||||
action_index += len;
|
||||
}
|
||||
@ -70,7 +70,7 @@ int size, element_size;
|
||||
if ( element_size * size <= 0 )
|
||||
flexfatal( "request for < 1 byte in allocate_array()" );
|
||||
|
||||
mem = yy_flex_alloc( element_size * size );
|
||||
mem = flex_alloc( element_size * size );
|
||||
|
||||
if ( mem == NULL )
|
||||
flexfatal( "memory allocation failed in allocate_array()" );
|
||||
@ -182,7 +182,7 @@ register char *str;
|
||||
for ( c = str; *c; ++c )
|
||||
;
|
||||
|
||||
copy = (char *) yy_flex_alloc( (c - str + 1) * sizeof( char ) );
|
||||
copy = (char *) flex_alloc( (c - str + 1) * sizeof( char ) );
|
||||
|
||||
if ( copy == NULL )
|
||||
flexfatal( "dynamic memory failure in copy_string()" );
|
||||
@ -647,7 +647,7 @@ int size, element_size;
|
||||
flexfatal(
|
||||
"attempt to increase array size by less than 1 byte" );
|
||||
|
||||
new_array = yy_flex_realloc( array, size * element_size );
|
||||
new_array = flex_realloc( array, size * element_size );
|
||||
|
||||
if ( new_array == NULL )
|
||||
flexfatal( "attempt to increase array size failed" );
|
||||
@ -745,7 +745,7 @@ int element_v, element_n;
|
||||
void *yy_flex_xmalloc( size )
|
||||
int size;
|
||||
{
|
||||
void *result = yy_flex_alloc( size );
|
||||
void *result = flex_alloc( size );
|
||||
|
||||
if ( ! result )
|
||||
flexfatal( "memory allocation failed in yy_flex_xmalloc()" );
|
||||
|
@ -27,7 +27,7 @@
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
/* $Header: /cvsroot/src/usr.bin/lex/Attic/scan.l,v 1.6 1993/12/09 19:06:27 jtc Exp $ */
|
||||
/* $Header: /cvsroot/src/usr.bin/lex/Attic/scan.l,v 1.7 1994/01/06 23:58:51 jtc Exp $ */
|
||||
|
||||
#include "flexdef.h"
|
||||
#include "parse.h"
|
||||
@ -43,11 +43,11 @@
|
||||
return CHAR;
|
||||
|
||||
#define RETURNNAME \
|
||||
yy_strcpy( nmstr, yytext ); \
|
||||
strcpy( nmstr, yytext ); \
|
||||
return NAME;
|
||||
|
||||
#define PUT_BACK_STRING(str, start) \
|
||||
for ( i = yy_strlen( str ) - 1; i >= start; --i ) \
|
||||
for ( i = 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} {
|
||||
yy_strcpy( nmstr, yytext );
|
||||
strcpy( nmstr, yytext );
|
||||
didadef = false;
|
||||
BEGIN(PICKUPDEF);
|
||||
}
|
||||
@ -171,10 +171,10 @@ CCL_CHAR ([^\\\n\]]|{ESCSEQ})
|
||||
<PICKUPDEF>{WS} /* separates name and definition */
|
||||
|
||||
<PICKUPDEF>{NOT_WS}.* {
|
||||
yy_strcpy( (char *) nmdef, yytext );
|
||||
strcpy( (char *) nmdef, yytext );
|
||||
|
||||
/* Skip trailing whitespace. */
|
||||
for ( i = yy_strlen( (char *) nmdef ) - 1;
|
||||
for ( i = 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;
|
||||
|
||||
yy_strcpy( nmstr, yytext );
|
||||
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();
|
||||
|
||||
yy_strcpy( nmstr, yytext + 1 );
|
||||
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 = yy_strlen( (char *) nmdefptr );
|
||||
int len = strlen( (char *) nmdefptr );
|
||||
|
||||
if ( lex_compat || nmdefptr[0] == '^' ||
|
||||
(len > 0 && nmdefptr[len - 1] == '$') )
|
||||
@ -548,3 +548,25 @@ char *file;
|
||||
infilename = "<stdin>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Wrapper routines for accessing the scanner's malloc routines. */
|
||||
|
||||
void *flex_alloc( size )
|
||||
unsigned int size;
|
||||
{
|
||||
return yy_flex_alloc( size );
|
||||
}
|
||||
|
||||
void *flex_realloc( ptr, size )
|
||||
void *ptr;
|
||||
unsigned int size;
|
||||
{
|
||||
return yy_flex_realloc( ptr, size );
|
||||
}
|
||||
|
||||
void flex_free( ptr )
|
||||
void *ptr;
|
||||
{
|
||||
yy_flex_free( ptr );
|
||||
}
|
||||
|
@ -26,7 +26,7 @@
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
/* $Header: /cvsroot/src/usr.bin/lex/Attic/sym.c,v 1.5 1993/12/06 19:29:33 jtc Exp $ */
|
||||
/* $Header: /cvsroot/src/usr.bin/lex/Attic/sym.c,v 1.6 1994/01/06 23:58:53 jtc Exp $ */
|
||||
|
||||
#include "flexdef.h"
|
||||
|
||||
@ -62,7 +62,7 @@ int table_size;
|
||||
|
||||
while ( sym_entry )
|
||||
{
|
||||
if ( ! yy_strcmp( sym, sym_entry->name ) )
|
||||
if ( ! strcmp( sym, sym_entry->name ) )
|
||||
{ /* entry already exists */
|
||||
return -1;
|
||||
}
|
||||
@ -72,7 +72,7 @@ int table_size;
|
||||
|
||||
/* create new entry */
|
||||
new_entry = (struct hash_entry *)
|
||||
yy_flex_alloc( sizeof( struct hash_entry ) );
|
||||
flex_alloc( sizeof( struct hash_entry ) );
|
||||
|
||||
if ( new_entry == NULL )
|
||||
flexfatal( "symbol table memory allocation failed" );
|
||||
@ -142,7 +142,7 @@ int table_size;
|
||||
|
||||
while ( sym_entry )
|
||||
{
|
||||
if ( ! yy_strcmp( sym, sym_entry->name ) )
|
||||
if ( ! strcmp( sym, sym_entry->name ) )
|
||||
return sym_entry;
|
||||
sym_entry = sym_entry->next;
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
#define FLEX_VERSION "2.4.5"
|
||||
#define FLEX_VERSION "2.4.6"
|
||||
|
Loading…
Reference in New Issue
Block a user