Update for flex 2.4.3.
This commit is contained in:
parent
35d4564f5c
commit
e3597376a1
|
@ -1,8 +1,8 @@
|
|||
# from: @(#)Makefile 5.1 (Berkeley) 6/18/90
|
||||
# $Id: Makefile,v 1.5 1993/12/03 19:01:24 jtc Exp $
|
||||
# $Id: Makefile,v 1.6 1993/12/06 19:26:01 jtc Exp $
|
||||
|
||||
LIB= l
|
||||
SRCS= liballoc.c libmain.c libyywrap.c
|
||||
SRCS= liballoc.c libmain.c libstring.c libyywrap.c
|
||||
NOPIC=
|
||||
|
||||
.include <bsd.lib.mk>
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
/* liballoc - flex run-time memory allocation */
|
||||
|
||||
/* $Header: /cvsroot/src/gnu/usr.bin/lex/lib/Attic/liballoc.c,v 1.1 1993/12/02 19:14:28 jtc Exp $ */
|
||||
|
||||
#include <stdio.h>
|
||||
/* $Header: /cvsroot/src/gnu/usr.bin/lex/lib/Attic/liballoc.c,v 1.2 1993/12/06 19:26:02 jtc Exp $ */
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
|
||||
|
@ -35,19 +33,3 @@ void *ptr;
|
|||
{
|
||||
free( ptr );
|
||||
}
|
||||
|
||||
/* The following is only used by bison/alloca. */
|
||||
void *yy_flex_xmalloc( size )
|
||||
int size;
|
||||
{
|
||||
void *result = yy_flex_alloc( size );
|
||||
|
||||
if ( ! result )
|
||||
{
|
||||
fprintf( stderr,
|
||||
"flex memory allocation failed in yy_flex_xmalloc()" );
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* libmain - flex run-time support library "main" function */
|
||||
|
||||
/* $Header: /cvsroot/src/gnu/usr.bin/lex/lib/Attic/libmain.c,v 1.4 1993/12/02 19:14:31 jtc Exp $ */
|
||||
/* $Header: /cvsroot/src/gnu/usr.bin/lex/lib/Attic/libmain.c,v 1.5 1993/12/06 19:26:04 jtc Exp $ */
|
||||
|
||||
extern int yylex();
|
||||
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
/* libstring - flex run-time string routines */
|
||||
|
||||
/* $Header: /cvsroot/src/gnu/usr.bin/lex/lib/Attic/libstring.c,v 1.1 1993/12/06 19:26:05 jtc Exp $ */
|
||||
|
||||
/* These routines exist only because it's a pain to portably include
|
||||
* <string.h>/<strings.h>, and the generated scanner needs access to
|
||||
* strcpy() to support yytext.
|
||||
*/
|
||||
|
||||
extern int yy_strcmp();
|
||||
extern void yy_strcpy();
|
||||
extern int yy_strlen();
|
||||
|
||||
|
||||
int yy_strcmp( s1, s2 )
|
||||
const char *s1;
|
||||
const char *s2;
|
||||
{
|
||||
while ( *s1 && *s2 )
|
||||
{
|
||||
unsigned char uc1 = (unsigned char) *s1;
|
||||
unsigned char uc2 = (unsigned char) *s2;
|
||||
|
||||
if ( uc1 > uc2 )
|
||||
return 1;
|
||||
|
||||
else if ( uc1 < uc2 )
|
||||
return -1;
|
||||
|
||||
++s1;
|
||||
++s2;
|
||||
}
|
||||
|
||||
if ( *s1 )
|
||||
/* s1 is longer than s2, so s1 > s2 */
|
||||
return 1;
|
||||
|
||||
else if ( *s2 )
|
||||
return -1;
|
||||
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
void yy_strcpy( s1, s2 )
|
||||
char *s1;
|
||||
const char *s2;
|
||||
{
|
||||
while ( (*(s1++) = *(s2++)) )
|
||||
;
|
||||
}
|
||||
|
||||
int yy_strlen( s )
|
||||
const char* s;
|
||||
{
|
||||
int len = 0;
|
||||
|
||||
while ( s[len] )
|
||||
++len;
|
||||
|
||||
return len;
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
/* libyywrap - flex run-time support library "yywrap" function */
|
||||
|
||||
/* $Header: /cvsroot/src/gnu/usr.bin/lex/lib/Attic/libyywrap.c,v 1.1 1993/12/02 19:14:33 jtc Exp $ */
|
||||
/* $Header: /cvsroot/src/gnu/usr.bin/lex/lib/Attic/libyywrap.c,v 1.2 1993/12/06 19:26:06 jtc Exp $ */
|
||||
|
||||
int yywrap()
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
# from: @(#)Makefile 5.1 (Berkeley) 6/18/90
|
||||
# $Id: Makefile,v 1.5 1993/12/03 19:01:24 jtc Exp $
|
||||
# $Id: Makefile,v 1.6 1993/12/06 19:26:01 jtc Exp $
|
||||
|
||||
LIB= l
|
||||
SRCS= liballoc.c libmain.c libyywrap.c
|
||||
SRCS= liballoc.c libmain.c libstring.c libyywrap.c
|
||||
NOPIC=
|
||||
|
||||
.include <bsd.lib.mk>
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
/* liballoc - flex run-time memory allocation */
|
||||
|
||||
/* $Header: /cvsroot/src/usr.bin/lex/lib/Attic/liballoc.c,v 1.1 1993/12/02 19:14:28 jtc Exp $ */
|
||||
|
||||
#include <stdio.h>
|
||||
/* $Header: /cvsroot/src/usr.bin/lex/lib/Attic/liballoc.c,v 1.2 1993/12/06 19:26:02 jtc Exp $ */
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
|
||||
|
@ -35,19 +33,3 @@ void *ptr;
|
|||
{
|
||||
free( ptr );
|
||||
}
|
||||
|
||||
/* The following is only used by bison/alloca. */
|
||||
void *yy_flex_xmalloc( size )
|
||||
int size;
|
||||
{
|
||||
void *result = yy_flex_alloc( size );
|
||||
|
||||
if ( ! result )
|
||||
{
|
||||
fprintf( stderr,
|
||||
"flex memory allocation failed in yy_flex_xmalloc()" );
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* libmain - flex run-time support library "main" function */
|
||||
|
||||
/* $Header: /cvsroot/src/usr.bin/lex/lib/Attic/libmain.c,v 1.4 1993/12/02 19:14:31 jtc Exp $ */
|
||||
/* $Header: /cvsroot/src/usr.bin/lex/lib/Attic/libmain.c,v 1.5 1993/12/06 19:26:04 jtc Exp $ */
|
||||
|
||||
extern int yylex();
|
||||
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
/* libstring - flex run-time string routines */
|
||||
|
||||
/* $Header: /cvsroot/src/usr.bin/lex/lib/Attic/libstring.c,v 1.1 1993/12/06 19:26:05 jtc Exp $ */
|
||||
|
||||
/* These routines exist only because it's a pain to portably include
|
||||
* <string.h>/<strings.h>, and the generated scanner needs access to
|
||||
* strcpy() to support yytext.
|
||||
*/
|
||||
|
||||
extern int yy_strcmp();
|
||||
extern void yy_strcpy();
|
||||
extern int yy_strlen();
|
||||
|
||||
|
||||
int yy_strcmp( s1, s2 )
|
||||
const char *s1;
|
||||
const char *s2;
|
||||
{
|
||||
while ( *s1 && *s2 )
|
||||
{
|
||||
unsigned char uc1 = (unsigned char) *s1;
|
||||
unsigned char uc2 = (unsigned char) *s2;
|
||||
|
||||
if ( uc1 > uc2 )
|
||||
return 1;
|
||||
|
||||
else if ( uc1 < uc2 )
|
||||
return -1;
|
||||
|
||||
++s1;
|
||||
++s2;
|
||||
}
|
||||
|
||||
if ( *s1 )
|
||||
/* s1 is longer than s2, so s1 > s2 */
|
||||
return 1;
|
||||
|
||||
else if ( *s2 )
|
||||
return -1;
|
||||
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
void yy_strcpy( s1, s2 )
|
||||
char *s1;
|
||||
const char *s2;
|
||||
{
|
||||
while ( (*(s1++) = *(s2++)) )
|
||||
;
|
||||
}
|
||||
|
||||
int yy_strlen( s )
|
||||
const char* s;
|
||||
{
|
||||
int len = 0;
|
||||
|
||||
while ( s[len] )
|
||||
++len;
|
||||
|
||||
return len;
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
/* libyywrap - flex run-time support library "yywrap" function */
|
||||
|
||||
/* $Header: /cvsroot/src/usr.bin/lex/lib/Attic/libyywrap.c,v 1.1 1993/12/02 19:14:33 jtc Exp $ */
|
||||
/* $Header: /cvsroot/src/usr.bin/lex/lib/Attic/libyywrap.c,v 1.2 1993/12/06 19:26:06 jtc Exp $ */
|
||||
|
||||
int yywrap()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue