aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-07-30 16:33:08 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-07-30 16:33:08 +0000
commit9f1fc1080e91005cad96f84463e2392604823024 (patch)
tree6ef13d6e0f5bd9efc7c4aad4ec7953f8c341a2c1
parent74780590d81150712e7971a9a6af24c0ef78842f (diff)
downloadpostgresql-9f1fc1080e91005cad96f84463e2392604823024.tar.gz
postgresql-9f1fc1080e91005cad96f84463e2392604823024.zip
Since we're depending on %option noyywrap in the main scanner now,
we may as well use it in all our flex files. Make all the flex files have a consistent set of options.
-rw-r--r--contrib/cube/cubescan.l8
-rw-r--r--contrib/seg/segscan.l8
-rw-r--r--contrib/tsearch/parser.l11
-rw-r--r--src/backend/bootstrap/bootscanner.l20
-rw-r--r--src/backend/utils/misc/guc-file.l19
-rw-r--r--src/interfaces/ecpg/preproc/pgc.l21
-rw-r--r--src/pl/plpgsql/src/scan.l14
7 files changed, 45 insertions, 56 deletions
diff --git a/contrib/cube/cubescan.l b/contrib/cube/cubescan.l
index e10e7faad8f..d1aed4c75ae 100644
--- a/contrib/cube/cubescan.l
+++ b/contrib/cube/cubescan.l
@@ -10,8 +10,6 @@
#include "cubeparse.h"
#include "buffer.h"
-#define YY_NO_UNPUT 1
-#undef yywrap
/* flex screws a couple symbols when used with the -P otion; fix those */
#define YY_DECL int cube_yylex YY_PROTO(( void )); \
@@ -28,6 +26,12 @@ int cube_yylex YY_PROTO(( void ))
void cube_flush_scanner_buffer(void);
%}
+%option 8bit
+%option never-interactive
+%option nounput
+%option noyywrap
+
+
n [0-9]+
integer [+-]?{n}
real [+-]?({n}\.{n}?)|(\.{n})
diff --git a/contrib/seg/segscan.l b/contrib/seg/segscan.l
index ea9032685a9..787fe28843c 100644
--- a/contrib/seg/segscan.l
+++ b/contrib/seg/segscan.l
@@ -8,8 +8,6 @@
#include "segparse.h"
#include "buffer.h"
-#define YY_NO_UNPUT 1
-#undef yywrap
/* flex screws a couple symbols when used with the -P otion; fix those */
#define YY_DECL int seg_yylex YY_PROTO(( void )); \
@@ -27,6 +25,12 @@ int seg_yylex YY_PROTO(( void ))
void seg_flush_scanner_buffer(void);
%}
+%option 8bit
+%option never-interactive
+%option nounput
+%option noyywrap
+
+
range (\.\.)(\.)?
plumin (\'\+\-\')|(\(\+\-)\)
integer [+-]?[0-9]+
diff --git a/contrib/tsearch/parser.l b/contrib/tsearch/parser.l
index 66b8cf56dfe..6081fd4c7be 100644
--- a/contrib/tsearch/parser.l
+++ b/contrib/tsearch/parser.l
@@ -50,9 +50,14 @@ int bytestoread = 0; /* for limiting read from filehandle */
} \
}
-#define YY_NO_UNPUT
%}
+%option 8bit
+%option never-interactive
+%option nounput
+%option noyywrap
+
+
/* parser's state for parsing defis-word */
%x DELIM
/* parser's state for parsing URL*/
@@ -289,10 +294,6 @@ ftp"://" {
%%
-int tsearch_yywrap(void) {
- return 1;
-}
-
/* clearing after parsing from string */
void end_parse() {
if (s) { free(s); s=NULL; }
diff --git a/src/backend/bootstrap/bootscanner.l b/src/backend/bootstrap/bootscanner.l
index 6261e8fc81b..ac94d0001bc 100644
--- a/src/backend/bootstrap/bootscanner.l
+++ b/src/backend/bootstrap/bootscanner.l
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootscanner.l,v 1.24 2002/06/20 20:29:26 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootscanner.l,v 1.25 2002/07/30 16:33:08 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -42,18 +42,18 @@
#include "bootstrap_tokens.h"
-#define YY_NO_UNPUT
-
-/* some versions of lex define this as a macro */
-#if defined(yywrap)
-#undef yywrap
-#endif /* yywrap */
YYSTYPE yylval;
int yyline; /* keep track of the line number for error reporting */
%}
+%option 8bit
+%option never-interactive
+%option nounput
+%option noyywrap
+
+
D [0-9]
oct \\{D}{D}{D}
Exp [Ee][-+]?{D}+
@@ -132,12 +132,6 @@ insert { return(INSERT_TUPLE); }
%%
-int
-yywrap(void)
-{
- return 1;
-}
-
void
yyerror(const char *str)
{
diff --git a/src/backend/utils/misc/guc-file.l b/src/backend/utils/misc/guc-file.l
index 2f50b4b55c6..48658a3cb2c 100644
--- a/src/backend/utils/misc/guc-file.l
+++ b/src/backend/utils/misc/guc-file.l
@@ -4,7 +4,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc-file.l,v 1.12 2002/05/17 01:19:18 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc-file.l,v 1.13 2002/07/30 16:33:08 tgl Exp $
*/
%{
@@ -38,18 +38,19 @@ enum {
GUC_ERROR = 100
};
-#if defined(yywrap)
-#undef yywrap
-#endif /* yywrap */
-
#define YY_USER_INIT (ConfigFileLineno = 1)
-#define YY_NO_UNPUT
/* prototype, so compiler is happy with our high warnings setting */
int GUC_yylex(void);
char *GUC_scanstr(char *);
%}
+%option 8bit
+%option never-interactive
+%option nounput
+%option noyywrap
+
+
SIGN ("-"|"+")
DIGIT [0-9]
HEXDIGIT [0-9a-fA-F]
@@ -271,12 +272,6 @@ ProcessConfigFile(GucContext context)
-int
-yywrap(void)
-{
- return 1;
-}
-
/* ----------------
* scanstr
*
diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l
index 9ecbc23cacb..20f08b6182a 100644
--- a/src/interfaces/ecpg/preproc/pgc.l
+++ b/src/interfaces/ecpg/preproc/pgc.l
@@ -12,7 +12,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.97 2002/07/20 08:24:18 meskes Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.98 2002/07/30 16:33:08 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -26,12 +26,6 @@
#include "extern.h"
#include "preproc.h"
-/* some versions of lex define this as a macro */
-#if defined(yywrap)
-#undef yywrap
-#endif /* yywrap */
-
-#define YY_NO_UNPUT
extern YYSTYPE yylval;
@@ -75,7 +69,13 @@ static struct _if_value
%}
+%option 8bit
+%option never-interactive
+%option nounput
+%option noyywrap
+
%option yylineno
+
%s C SQL incl def def_ident
/*
@@ -945,10 +945,3 @@ addlitchar(unsigned char ychar)
literallen += 1;
literalbuf[literallen] = '\0';
}
-
-int
-yywrap(void)
-{
- return(1);
-}
-
diff --git a/src/pl/plpgsql/src/scan.l b/src/pl/plpgsql/src/scan.l
index a9f69975000..546a43e5192 100644
--- a/src/pl/plpgsql/src/scan.l
+++ b/src/pl/plpgsql/src/scan.l
@@ -4,7 +4,7 @@
* procedural language
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/scan.l,v 1.17 2002/03/06 18:50:29 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/scan.l,v 1.18 2002/07/30 16:33:08 tgl Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
@@ -52,9 +52,13 @@ int plpgsql_SpaceScanned = 0;
static void plpgsql_input(char *buf, int *result, int max);
#define YY_INPUT(buf,res,max) plpgsql_input(buf, &res, max)
-#define YY_NO_UNPUT
%}
+%option 8bit
+%option never-interactive
+%option nounput
+%option noyywrap
+
%option yylineno
@@ -215,12 +219,6 @@ dump { return O_DUMP; }
%%
-int
-yywrap()
-{
- return 1;
-}
-
static void
plpgsql_input(char *buf, int *result, int max)