summaryrefslogtreecommitdiff
path: root/usr.bin/lex/flex.skl
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/lex/flex.skl')
-rw-r--r--usr.bin/lex/flex.skl38
1 files changed, 30 insertions, 8 deletions
diff --git a/usr.bin/lex/flex.skl b/usr.bin/lex/flex.skl
index 527c70df21b..62b0fefae76 100644
--- a/usr.bin/lex/flex.skl
+++ b/usr.bin/lex/flex.skl
@@ -1,9 +1,9 @@
-/* $OpenBSD: flex.skl,v 1.2 1996/06/26 05:35:32 deraadt Exp $ */
+/* $OpenBSD: flex.skl,v 1.3 1996/07/13 22:21:58 millert Exp $ */
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
- * $Header: /cvs/OpenBSD/src/usr.bin/lex/flex.skl,v 1.2 1996/06/26 05:35:32 deraadt Exp $
+ * $Header: /cvs/OpenBSD/src/usr.bin/lex/flex.skl,v 1.3 1996/07/13 22:21:58 millert Exp $
*/
#define FLEX_SCANNER
@@ -135,6 +135,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 */ \
} \
@@ -321,6 +322,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
%- Standard (non-C++) definition
#ifdef __cplusplus
@@ -520,6 +525,7 @@ do_action: /* This label is used only to access EOF actions. */
/* 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 )
{
@@ -657,6 +663,7 @@ yyFlexLexer::yyFlexLexer( istream* arg_yyin, ostream* arg_yyout )
yy_looking_for_trail_begin = 0;
yy_more_flag = 0;
yy_more_len = 0;
+ yy_more_offset = yy_prev_more_offset = 0;
yy_start_stack_ptr = yy_start_stack_depth = 0;
yy_start_stack = 0;
@@ -751,7 +758,7 @@ int yyFlexLexer::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;
@@ -987,7 +994,7 @@ int yyFlexLexer::yyinput()
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() )
@@ -996,8 +1003,7 @@ int yyFlexLexer::yyinput()
{
if ( yywrap() )
{
- yy_c_buf_p =
- yytext_ptr + YY_MORE_ADJ;
+ yy_c_buf_p = yytext_ptr + offset;
return EOF;
}
@@ -1011,7 +1017,7 @@ int yyFlexLexer::yyinput()
}
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:
@@ -1437,7 +1443,7 @@ void yyFlexLexer::LexerError( yyconst 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; \
@@ -1463,6 +1469,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 )