From 27c2321b81de20dfac8255492e25ca25b66c6c3b Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sat, 13 Jul 1996 22:22:16 +0000 Subject: updated to flex 2.5.3 --- usr.bin/lex/initscan.c | 46 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 12 deletions(-) (limited to 'usr.bin/lex/initscan.c') diff --git a/usr.bin/lex/initscan.c b/usr.bin/lex/initscan.c index 80ed3f1684c..b0f9140d98c 100644 --- a/usr.bin/lex/initscan.c +++ b/usr.bin/lex/initscan.c @@ -1,10 +1,10 @@ -/* $OpenBSD: initscan.c,v 1.2 1996/06/26 05:35:36 deraadt Exp $ */ +/* $OpenBSD: initscan.c,v 1.3 1996/07/13 22:22:03 millert Exp $ */ #line 2 "scan.c" /* A lexical scanner generated by flex */ /* Scanner skeleton version: - * $Header: /cvs/OpenBSD/src/usr.bin/lex/initscan.c,v 1.2 1996/06/26 05:35:36 deraadt Exp $ + * $Header: /cvs/OpenBSD/src/usr.bin/lex/initscan.c,v 1.3 1996/07/13 22:22:03 millert Exp $ */ #define FLEX_SCANNER @@ -129,6 +129,7 @@ extern FILE *yyin, *yyout; { \ /* Undo effects of setting up yytext. */ \ *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ @@ -1239,6 +1240,7 @@ static char *yy_last_accepting_cpos; #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "scan.l" #define INITIAL 0 @@ -1270,7 +1272,7 @@ char *yytext; * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -/* $Header: /cvs/OpenBSD/src/usr.bin/lex/initscan.c,v 1.2 1996/06/26 05:35:36 deraadt Exp $ */ +/* $Header: /cvs/OpenBSD/src/usr.bin/lex/initscan.c,v 1.3 1996/07/13 22:22:03 millert Exp $ */ #include "flexdef.h" #include "parse.h" @@ -1329,7 +1331,7 @@ char *yytext; #define OPTION 17 #define LINEDIR 18 -#line 1331 "scan.c" +#line 1333 "scan.c" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1351,6 +1353,10 @@ static void yyunput YY_PROTO(( int c, char *buf_ptr )); static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); #endif +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen YY_PROTO(( yyconst char * )); +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput YY_PROTO(( void )); @@ -1490,7 +1496,7 @@ YY_DECL Char nmdef[MAXLINE], myesc(); -#line 1492 "scan.c" +#line 1498 "scan.c" if ( yy_init ) { @@ -2728,7 +2734,7 @@ YY_RULE_SETUP #line 650 "scan.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 2730 "scan.c" +#line 2736 "scan.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(SECT2): case YY_STATE_EOF(CODEBLOCK): @@ -2752,6 +2758,7 @@ case YY_STATE_EOF(LINEDIR): /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) { @@ -2897,7 +2904,7 @@ static int yy_get_next_buffer() { /* Don't try to fill the buffer, so this is an EOF. */ if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) { - /* We matched a singled characater, the EOB, so + /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; @@ -3142,7 +3149,7 @@ static int input() else { /* need more input */ - yytext_ptr = yy_c_buf_p; + int offset = yy_c_buf_p - yytext_ptr; ++yy_c_buf_p; switch ( yy_get_next_buffer() ) @@ -3151,8 +3158,7 @@ static int input() { if ( yywrap() ) { - yy_c_buf_p = - yytext_ptr + YY_MORE_ADJ; + yy_c_buf_p = yytext_ptr + offset; return EOF; } @@ -3166,7 +3172,7 @@ static int input() } case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + yy_c_buf_p = yytext_ptr + offset; break; case EOB_ACT_LAST_MATCH: @@ -3531,7 +3537,7 @@ char msg[]; { \ /* Undo effects of setting up yytext. */ \ yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n - YY_MORE_ADJ; \ + yy_c_buf_p = yytext + n; \ yy_hold_char = *yy_c_buf_p; \ *yy_c_buf_p = '\0'; \ yyleng = n; \ @@ -3557,6 +3563,22 @@ int n; } #endif +#ifdef YY_NEED_STRLEN +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif + { + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; + } +#endif + #ifdef YY_USE_PROTOS static void *yy_flex_alloc( yy_size_t size ) -- cgit v1.2.3