Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src use %option instead of #define YY_NO_...



details:   https://anonhg.NetBSD.org/src/rev/417162a4bab9
branches:  trunk
changeset: 748641:417162a4bab9
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Oct 29 14:49:02 2009 +0000

description:
use %option instead of #define YY_NO_...

diffstat:

 crypto/dist/heimdal/lib/com_err/lex.l  |  5 ++---
 crypto/dist/heimdal/lib/sl/lex.l       |  5 ++---
 crypto/dist/heimdal/lib/sl/slc-lex.l   |  6 ++++--
 dist/libpcap/scanner.l                 |  5 +++--
 external/gpl3/binutils/dist/ld/ldlex.l |  3 ++-
 gnu/dist/binutils/ld/ldlex.l           |  5 +++--
 lib/libc/net/nslexer.l                 |  8 +++-----
 sbin/cgdconfig/cgdlex.l                |  6 +++---
 sbin/veriexecctl/veriexecctl_conf.l    |  5 +++--
 usr.bin/fgen/fgen.l                    |  7 ++++---
 usr.bin/m4/tokenizer.l                 |  7 ++++---
 usr.bin/mkesdb/lex.l                   |  7 +++----
 usr.bin/xlint/lint1/scan.l             |  7 ++++---
 usr.sbin/ndiscvt/inf-token.l           |  5 +++--
 14 files changed, 43 insertions(+), 38 deletions(-)

diffs (truncated from 395 to 300 lines):

diff -r 92b76e469bfc -r 417162a4bab9 crypto/dist/heimdal/lib/com_err/lex.l
--- a/crypto/dist/heimdal/lib/com_err/lex.l     Thu Oct 29 14:44:09 2009 +0000
+++ b/crypto/dist/heimdal/lib/com_err/lex.l     Thu Oct 29 14:49:02 2009 +0000
@@ -45,17 +45,16 @@
 #include "lex.h"
 
 __RCSID("$Heimdal: lex.l 15143 2005-05-16 08:52:54Z lha $"
-        "$NetBSD: lex.l,v 1.3 2008/03/22 08:37:06 mlelstv Exp $");
+        "$NetBSD: lex.l,v 1.4 2009/10/29 14:49:02 christos Exp $");
 
 static unsigned lineno = 1;
 static int getstring(void);
 
-#define YY_NO_UNPUT
-
 #undef ECHO
 
 %}
 
+%option nounput
 
 %%
 et                     { return ET; }
diff -r 92b76e469bfc -r 417162a4bab9 crypto/dist/heimdal/lib/sl/lex.l
--- a/crypto/dist/heimdal/lib/sl/lex.l  Thu Oct 29 14:44:09 2009 +0000
+++ b/crypto/dist/heimdal/lib/sl/lex.l  Thu Oct 29 14:49:02 2009 +0000
@@ -38,17 +38,16 @@
 #include "parse.h"
 
 __RCSID("$Heimdal: lex.l 10703 2001-09-16 23:10:10Z assar $"
-        "$NetBSD: lex.l,v 1.5 2008/03/22 08:37:23 mlelstv Exp $");
+        "$NetBSD: lex.l,v 1.6 2009/10/29 14:49:03 christos Exp $");
 
 static unsigned lineno = 1;
 static int getstring(void);
 
-#define YY_NO_UNPUT
-
 #undef ECHO
 
 %}
 
+%option nounput
 
 %%
 command_table          { return TABLE; }
diff -r 92b76e469bfc -r 417162a4bab9 crypto/dist/heimdal/lib/sl/slc-lex.l
--- a/crypto/dist/heimdal/lib/sl/slc-lex.l      Thu Oct 29 14:44:09 2009 +0000
+++ b/crypto/dist/heimdal/lib/sl/slc-lex.l      Thu Oct 29 14:49:02 2009 +0000
@@ -33,7 +33,7 @@
  */
 
 /* $Heimdal: slc-lex.l 15118 2005-05-10 22:19:01Z lha $
-   $NetBSD: slc-lex.l,v 1.1 2008/03/22 08:37:23 mlelstv Exp $ */
+   $NetBSD: slc-lex.l,v 1.2 2009/10/29 14:49:03 christos Exp $ */
 
 #undef ECHO
 
@@ -48,11 +48,13 @@
 static void handle_comment(void);
 static char * handle_string(void);
 
-#define YY_NO_UNPUT
 
 #undef ECHO
 
 %}
+
+%option nounput
+
 %%
 [A-Za-z][-A-Za-z0-9_]* {
                          yylval.string = strdup ((const char *)yytext);
diff -r 92b76e469bfc -r 417162a4bab9 dist/libpcap/scanner.l
--- a/dist/libpcap/scanner.l    Thu Oct 29 14:44:09 2009 +0000
+++ b/dist/libpcap/scanner.l    Thu Oct 29 14:49:02 2009 +0000
@@ -22,7 +22,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /cvsroot/src/dist/libpcap/Attic/scanner.l,v 1.2 2006/02/27 15:55:30 drochner Exp $ (LBL)";
+    "@(#) $Header: /cvsroot/src/dist/libpcap/Attic/scanner.l,v 1.3 2009/10/29 14:49:03 christos Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -63,7 +63,6 @@
 static inline int xdtoi(int);
 
 #ifdef FLEX_SCANNER
-#define YY_NO_UNPUT
 static YY_BUFFER_STATE in_buffer;
 #else
 static char *in_buffer;
@@ -166,6 +165,8 @@
 
 V6             
({V680}|{V670}|{V671}|{V672}|{V673}|{V674}|{V675}|{V676}|{V677}|{V660}|{V661}|{V662}|{V663}|{V664}|{V665}|{V666}|{V650}|{V651}|{V652}|{V653}|{V654}|{V655}|{V640}|{V641}|{V642}|{V643}|{V644}|{V630}|{V631}|{V632}|{V633}|{V620}|{V621}|{V622}|{V610}|{V611}|{V600}|{V6604}|{V6504}|{V6514}|{V6524}|{V6534}|{V6544}|{V6554}|{V6404}|{V6414}|{V6424}|{V6434}|{V6444}|{V6304}|{V6314}|{V6324}|{V6334}|{V6204}|{V6214}|{V6224}|{V6104}|{V6114}|{V6004})
 
+%option nounput
+
 %%
 dst            return DST;
 src            return SRC;
diff -r 92b76e469bfc -r 417162a4bab9 external/gpl3/binutils/dist/ld/ldlex.l
--- a/external/gpl3/binutils/dist/ld/ldlex.l    Thu Oct 29 14:44:09 2009 +0000
+++ b/external/gpl3/binutils/dist/ld/ldlex.l    Thu Oct 29 14:49:02 2009 +0000
@@ -59,7 +59,6 @@
 #undef YY_INPUT
 #define YY_INPUT(buf,result,max_size) yy_input (buf, &result, max_size)
 
-#define YY_NO_UNPUT
 
 #define MAX_INCLUDE_DEPTH 10
 static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
@@ -90,6 +89,8 @@
 #endif
 %}
 
+%option nounput
+
 %a 4000
 %o 5000
 
diff -r 92b76e469bfc -r 417162a4bab9 gnu/dist/binutils/ld/ldlex.l
--- a/gnu/dist/binutils/ld/ldlex.l      Thu Oct 29 14:44:09 2009 +0000
+++ b/gnu/dist/binutils/ld/ldlex.l      Thu Oct 29 14:49:02 2009 +0000
@@ -65,8 +65,6 @@
 #undef YY_INPUT
 #define YY_INPUT(buf,result,max_size) yy_input (buf, &result, max_size)
 
-#define YY_NO_UNPUT
-
 #define MAX_INCLUDE_DEPTH 10
 static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
 static const char *file_name_stack[MAX_INCLUDE_DEPTH];
@@ -120,6 +118,9 @@
 %s VERS_START
 %s VERS_SCRIPT
 %s VERS_NODE
+
+%option nounput
+
 %%
 
   if (parser_input != input_selected)
diff -r 92b76e469bfc -r 417162a4bab9 lib/libc/net/nslexer.l
--- a/lib/libc/net/nslexer.l    Thu Oct 29 14:44:09 2009 +0000
+++ b/lib/libc/net/nslexer.l    Thu Oct 29 14:49:02 2009 +0000
@@ -1,5 +1,5 @@
 %{
-/*     $NetBSD: nslexer.l,v 1.8 2008/04/28 20:23:00 martin Exp $       */
+/*     $NetBSD: nslexer.l,v 1.9 2009/10/29 14:49:03 christos Exp $     */
 
 /*-
  * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: nslexer.l,v 1.8 2008/04/28 20:23:00 martin Exp $");
+__RCSID("$NetBSD: nslexer.l,v 1.9 2009/10/29 14:49:03 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -44,11 +44,9 @@
 
 #include "nsparser.h"
 
-#define YY_NO_UNPUT
-
 %}
 
-%option yylineno
+%option yylineno nounput
 %option never-interactive
 
 BLANK          [ \t]
diff -r 92b76e469bfc -r 417162a4bab9 sbin/cgdconfig/cgdlex.l
--- a/sbin/cgdconfig/cgdlex.l   Thu Oct 29 14:44:09 2009 +0000
+++ b/sbin/cgdconfig/cgdlex.l   Thu Oct 29 14:49:02 2009 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgdlex.l,v 1.4 2009/10/28 20:59:46 christos Exp $ */
+/* $NetBSD: cgdlex.l,v 1.5 2009/10/29 14:49:03 christos Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: cgdlex.l,v 1.4 2009/10/28 20:59:46 christos Exp $");
+__RCSID("$NetBSD: cgdlex.l,v 1.5 2009/10/29 14:49:03 christos Exp $");
 #endif
 
 #include <err.h>
@@ -41,7 +41,6 @@
 #include "utils.h"
 #include "cgdparse.h"
 
-#define YY_NO_UNPUT
 /*
  * We use macros here to separate the C from the tokeniser, to
  * ease reading each.
@@ -87,6 +86,7 @@
 %}
 
 %x quoted
+%option nounput
 
 %%
 
diff -r 92b76e469bfc -r 417162a4bab9 sbin/veriexecctl/veriexecctl_conf.l
--- a/sbin/veriexecctl/veriexecctl_conf.l       Thu Oct 29 14:44:09 2009 +0000
+++ b/sbin/veriexecctl/veriexecctl_conf.l       Thu Oct 29 14:49:02 2009 +0000
@@ -1,5 +1,5 @@
 %{
-/*     $NetBSD: veriexecctl_conf.l,v 1.13 2009/10/28 17:25:44 christos Exp $   */
+/*     $NetBSD: veriexecctl_conf.l,v 1.14 2009/10/29 14:49:03 christos Exp $   */
 
 /*-
  * Copyright 2005 Elad Efrat <elad%NetBSD.org@localhost>
@@ -40,7 +40,6 @@
 
 #include "veriexecctl_parse.h"
 
-#define YY_NO_UNPUT
 int yylex(void);
 
 extern size_t line;
@@ -82,6 +81,8 @@
 STRING         [0-9a-zA-Z]+
 PCHAR           (\\.|[^ \t])
 
+%option nounput
+
 %%
 
        /* path */
diff -r 92b76e469bfc -r 417162a4bab9 usr.bin/fgen/fgen.l
--- a/usr.bin/fgen/fgen.l       Thu Oct 29 14:44:09 2009 +0000
+++ b/usr.bin/fgen/fgen.l       Thu Oct 29 14:49:02 2009 +0000
@@ -1,5 +1,5 @@
 %{
-/*     $NetBSD: fgen.l,v 1.32 2009/10/29 14:35:25 christos Exp $       */
+/*     $NetBSD: fgen.l,v 1.33 2009/10/29 14:49:03 christos Exp $       */
 /* FLEX input for FORTH input file scanner */
 /*  
  * Copyright (c) 1998 Eduardo Horvath.
@@ -42,7 +42,7 @@
 #endif
 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: fgen.l,v 1.32 2009/10/29 14:35:25 christos Exp $");
+__RCSID("$NetBSD: fgen.l,v 1.33 2009/10/29 14:49:03 christos Exp $");
 #endif
 
 %}
@@ -103,9 +103,10 @@
 #define ASSERT if (debug) assert
 #define STATE(y, x)    do { if (debug) printf( "%ld State %s: token `%s'\n", outpos, x, y); } while (0)
 
-#define YY_NO_UNPUT
 %}
 
+%option nounput
+
 %%
 
 0              { ltoken.type = TOK_OTHER; ltoken.text = yytext; return &ltoken; }
diff -r 92b76e469bfc -r 417162a4bab9 usr.bin/m4/tokenizer.l
--- a/usr.bin/m4/tokenizer.l    Thu Oct 29 14:44:09 2009 +0000
+++ b/usr.bin/m4/tokenizer.l    Thu Oct 29 14:49:02 2009 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: tokenizer.l,v 1.3 2009/10/28 21:42:47 christos Exp $ */
+/* $NetBSD: tokenizer.l,v 1.4 2009/10/29 14:49:03 christos Exp $ */
 /* $OpenBSD: tokenizer.l,v 1.6 2008/08/21 21:00:14 espie Exp $ */
 /*
  * Copyright (c) 2004 Marc Espie <espie%cvs.openbsd.org@localhost>
@@ -20,7 +20,7 @@
 #include "nbtool_config.h"
 #endif
 #include "parser.h"
-__RCSID("$NetBSD: tokenizer.l,v 1.3 2009/10/28 21:42:47 christos Exp $");
+__RCSID("$NetBSD: tokenizer.l,v 1.4 2009/10/29 14:49:03 christos Exp $");
 #include <stdlib.h>
 #include <errno.h>
 #include <stdint.h>
@@ -34,9 +34,10 @@
 int32_t number(void);
 int32_t parse_radix(void);
 
-#define YY_NO_UNPUT
 %}
 
+%option nounput
+
 delim  [ \t\n]
 ws     {delim}+
 hex    0[xX][0-9a-fA-F]+



Home | Main Index | Thread Index | Old Index