Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/lex Bring up-to-date with flex.skl.
details: https://anonhg.NetBSD.org/src/rev/2da629e6ff27
branches: trunk
changeset: 515773:2da629e6ff27
user: tv <tv%NetBSD.org@localhost>
date: Thu Oct 04 17:12:27 2001 +0000
description:
Bring up-to-date with flex.skl.
diffstat:
usr.bin/lex/initscan.c | 203 +++++++++++++++++++++++++-----------------------
1 files changed, 107 insertions(+), 96 deletions(-)
diffs (truncated from 674 to 300 lines):
diff -r 423604ec4017 -r 2da629e6ff27 usr.bin/lex/initscan.c
--- a/usr.bin/lex/initscan.c Thu Oct 04 16:46:22 2001 +0000
+++ b/usr.bin/lex/initscan.c Thu Oct 04 17:12:27 2001 +0000
@@ -2,7 +2,7 @@
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
- * $NetBSD: initscan.c,v 1.13 1999/01/18 22:18:17 christos Exp $
+ * $NetBSD: initscan.c,v 1.14 2001/10/04 17:12:27 tv Exp $
*/
#define FLEX_SCANNER
@@ -238,11 +238,7 @@
YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
-YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
-
-static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
-static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
-static void yy_flex_free YY_PROTO(( void * ));
+YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, yy_size_t len ));
#define yy_new_buffer yy_create_buffer
@@ -268,6 +264,12 @@
extern char *yytext;
#define yytext_ptr yytext
+static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
+#ifndef YY_USES_REJECT
+static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
+#endif
+static void yy_flex_free 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 ));
@@ -1270,7 +1272,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-/* $Header: /cvsroot/src/usr.bin/lex/Attic/initscan.c,v 1.13 1999/01/18 22:18:17 christos Exp $ */
+/* $NetBSD: initscan.c,v 1.14 2001/10/04 17:12:27 tv Exp $ */
#include "flexdef.h"
#include "parse.h"
@@ -1329,7 +1331,7 @@
#define OPTION 17
#define LINEDIR 18
-#line 1333 "scan.c"
+#line 1335 "scan.c"
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -1344,15 +1346,19 @@
#endif
#ifndef YY_NO_UNPUT
-static void yyunput YY_PROTO(( int c, char *buf_ptr ));
+static void yyunput YY_PROTO(( int c, char *buf_ptr ))
+#ifdef __GNUC__
+ __attribute__ ((unused))
+#endif
+;
#endif
#ifndef yytext_ptr
-static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, yy_size_t ));
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen YY_PROTO(( yyconst char * ));
+static yy_size_t yy_flex_strlen YY_PROTO(( yyconst char * ));
#endif
#ifndef YY_NO_INPUT
@@ -1409,7 +1415,7 @@
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#define ECHO (void) fwrite( yytext, (size_t)yyleng, 1, yyout )
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -1468,7 +1474,7 @@
/* Code executed at the end of each rule. */
#ifndef YY_BREAK
-#define YY_BREAK break;
+#define YY_BREAK /*LINTED*/break;
#endif
#define YY_RULE_SETUP \
@@ -1491,11 +1497,16 @@
int doing_codeblock = false;
int i;
- Char nmdef[MAXLINE], myesc();
-
-
-#line 1498 "scan.c"
-
+ Char nmdef[MAXLINE];
+
+
+#line 1504 "scan.c"
+
+#if defined(YY_USES_REJECT) && (defined(__GNUC__) || defined(lint))
+ /* XXX: shut up `unused label' warning with %options yylineno */
+ if (/*CONSTCOND*/0 && yy_full_match)
+ goto find_rule;
+#endif
if ( yy_init )
{
yy_init = 0;
@@ -1520,7 +1531,7 @@
yy_load_buffer_state();
}
- while ( 1 ) /* loops until end-of-file is reached */
+ while (/*CONSTCOND*/ 1 ) /* loops until end-of-file is reached */
{
yy_cp = yy_c_buf_p;
@@ -2291,7 +2302,6 @@
#line 435 "scan.l"
{
register Char *nmdefptr;
- Char *ndlookup();
strcpy( nmstr, yytext + 1 );
nmstr[yyleng - 2] = '\0'; /* chop trailing brace */
@@ -2325,24 +2335,24 @@
YY_BREAK
case 107:
YY_RULE_SETUP
-#line 469 "scan.l"
+#line 468 "scan.l"
return (unsigned char) yytext[0];
YY_BREAK
case 108:
YY_RULE_SETUP
-#line 470 "scan.l"
+#line 469 "scan.l"
RETURNCHAR;
YY_BREAK
case 109:
YY_RULE_SETUP
-#line 475 "scan.l"
+#line 474 "scan.l"
return (unsigned char) yytext[0];
YY_BREAK
case 110:
YY_RULE_SETUP
-#line 476 "scan.l"
+#line 475 "scan.l"
BEGIN(SECT2); return '>';
YY_BREAK
case 111:
@@ -2350,17 +2360,17 @@
yy_c_buf_p = yy_cp = yy_bp + 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 477 "scan.l"
+#line 476 "scan.l"
BEGIN(CARETISBOL); return '>';
YY_BREAK
case 112:
YY_RULE_SETUP
-#line 478 "scan.l"
+#line 477 "scan.l"
RETURNNAME;
YY_BREAK
case 113:
YY_RULE_SETUP
-#line 479 "scan.l"
+#line 478 "scan.l"
{
format_synerr( _( "bad <start condition>: %s" ),
yytext );
@@ -2369,23 +2379,23 @@
case 114:
YY_RULE_SETUP
-#line 485 "scan.l"
+#line 484 "scan.l"
BEGIN(SECT2); return '^';
YY_BREAK
case 115:
YY_RULE_SETUP
-#line 489 "scan.l"
+#line 488 "scan.l"
RETURNCHAR;
YY_BREAK
case 116:
YY_RULE_SETUP
-#line 490 "scan.l"
+#line 489 "scan.l"
BEGIN(SECT2); return '"';
YY_BREAK
case 117:
YY_RULE_SETUP
-#line 492 "scan.l"
+#line 491 "scan.l"
{
synerr( _( "missing quote" ) );
BEGIN(SECT2);
@@ -2400,7 +2410,7 @@
yy_c_buf_p = yy_cp = yy_bp + 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 502 "scan.l"
+#line 501 "scan.l"
BEGIN(CCL); return '^';
YY_BREAK
case 119:
@@ -2408,12 +2418,12 @@
yy_c_buf_p = yy_cp = yy_bp + 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 503 "scan.l"
+#line 502 "scan.l"
return '^';
YY_BREAK
case 120:
YY_RULE_SETUP
-#line 504 "scan.l"
+#line 503 "scan.l"
BEGIN(CCL); RETURNCHAR;
YY_BREAK
@@ -2423,22 +2433,22 @@
yy_c_buf_p = yy_cp = yy_bp + 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 508 "scan.l"
+#line 507 "scan.l"
return '-';
YY_BREAK
case 122:
YY_RULE_SETUP
-#line 509 "scan.l"
+#line 508 "scan.l"
RETURNCHAR;
YY_BREAK
case 123:
YY_RULE_SETUP
-#line 510 "scan.l"
+#line 509 "scan.l"
BEGIN(SECT2); return ']';
YY_BREAK
case 124:
YY_RULE_SETUP
-#line 511 "scan.l"
+#line 510 "scan.l"
{
synerr( _( "bad character class" ) );
BEGIN(SECT2);
@@ -2449,67 +2459,67 @@
case 125:
YY_RULE_SETUP
-#line 519 "scan.l"
+#line 518 "scan.l"
BEGIN(CCL); return CCE_ALNUM;
YY_BREAK
case 126:
YY_RULE_SETUP
-#line 520 "scan.l"
+#line 519 "scan.l"
BEGIN(CCL); return CCE_ALPHA;
YY_BREAK
case 127:
YY_RULE_SETUP
-#line 521 "scan.l"
+#line 520 "scan.l"
BEGIN(CCL); return CCE_BLANK;
YY_BREAK
case 128:
YY_RULE_SETUP
-#line 522 "scan.l"
+#line 521 "scan.l"
BEGIN(CCL); return CCE_CNTRL;
YY_BREAK
case 129:
YY_RULE_SETUP
-#line 523 "scan.l"
+#line 522 "scan.l"
BEGIN(CCL); return CCE_DIGIT;
YY_BREAK
case 130:
YY_RULE_SETUP
-#line 524 "scan.l"
Home |
Main Index |
Thread Index |
Old Index