Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 9f1fc10

Browse files
committed
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.
1 parent 7478059 commit 9f1fc10

File tree

7 files changed

+45
-56
lines changed

7 files changed

+45
-56
lines changed

contrib/cube/cubescan.l

+6-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
#include "cubeparse.h"
1111
#include "buffer.h"
1212

13-
#define YY_NO_UNPUT 1
14-
#undef yywrap
1513

1614
/* flex screws a couple symbols when used with the -P otion; fix those */
1715
#define YY_DECL int cube_yylex YY_PROTO(( void )); \
@@ -28,6 +26,12 @@ int cube_yylex YY_PROTO(( void ))
2826
void cube_flush_scanner_buffer(void);
2927
%}
3028

29+
%option 8bit
30+
%option never-interactive
31+
%option nounput
32+
%option noyywrap
33+
34+
3135
n [0-9]+
3236
integer [+-]?{n}
3337
real [+-]?({n}\.{n}?)|(\.{n})

contrib/seg/segscan.l

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
#include "segparse.h"
99
#include "buffer.h"
1010

11-
#define YY_NO_UNPUT 1
12-
#undef yywrap
1311

1412
/* flex screws a couple symbols when used with the -P otion; fix those */
1513
#define YY_DECL int seg_yylex YY_PROTO(( void )); \
@@ -27,6 +25,12 @@ int seg_yylex YY_PROTO(( void ))
2725
void seg_flush_scanner_buffer(void);
2826
%}
2927

28+
%option 8bit
29+
%option never-interactive
30+
%option nounput
31+
%option noyywrap
32+
33+
3034
range (\.\.)(\.)?
3135
plumin (\'\+\-\')|(\(\+\-)\)
3236
integer [+-]?[0-9]+

contrib/tsearch/parser.l

+6-5
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,14 @@ int bytestoread = 0; /* for limiting read from filehandle */
5050
} \
5151
}
5252

53-
#define YY_NO_UNPUT
5453
%}
5554

55+
%option 8bit
56+
%option never-interactive
57+
%option nounput
58+
%option noyywrap
59+
60+
5661
/* parser's state for parsing defis-word */
5762
%x DELIM
5863
/* parser's state for parsing URL*/
@@ -289,10 +294,6 @@ ftp"://" {
289294

290295
%%
291296

292-
int tsearch_yywrap(void) {
293-
return 1;
294-
}
295-
296297
/* clearing after parsing from string */
297298
void end_parse() {
298299
if (s) { free(s); s=NULL; }

src/backend/bootstrap/bootscanner.l

+7-13
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootscanner.l,v 1.24 2002/06/20 20:29:26 momjian Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootscanner.l,v 1.25 2002/07/30 16:33:08 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -42,18 +42,18 @@
4242

4343
#include "bootstrap_tokens.h"
4444

45-
#define YY_NO_UNPUT
46-
47-
/* some versions of lex define this as a macro */
48-
#if defined(yywrap)
49-
#undef yywrap
50-
#endif /* yywrap */
5145

5246
YYSTYPE yylval;
5347
int yyline; /* keep track of the line number for error reporting */
5448

5549
%}
5650

51+
%option 8bit
52+
%option never-interactive
53+
%option nounput
54+
%option noyywrap
55+
56+
5757
D [0-9]
5858
oct \\{D}{D}{D}
5959
Exp [Ee][-+]?{D}+
@@ -132,12 +132,6 @@ insert { return(INSERT_TUPLE); }
132132

133133
%%
134134

135-
int
136-
yywrap(void)
137-
{
138-
return 1;
139-
}
140-
141135
void
142136
yyerror(const char *str)
143137
{

src/backend/utils/misc/guc-file.l

+7-12
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Copyright 2000 by PostgreSQL Global Development Group
66
*
7-
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc-file.l,v 1.12 2002/05/17 01:19:18 tgl Exp $
7+
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc-file.l,v 1.13 2002/07/30 16:33:08 tgl Exp $
88
*/
99

1010
%{
@@ -38,18 +38,19 @@ enum {
3838
GUC_ERROR = 100
3939
};
4040

41-
#if defined(yywrap)
42-
#undef yywrap
43-
#endif /* yywrap */
44-
4541
#define YY_USER_INIT (ConfigFileLineno = 1)
46-
#define YY_NO_UNPUT
4742

4843
/* prototype, so compiler is happy with our high warnings setting */
4944
int GUC_yylex(void);
5045
char *GUC_scanstr(char *);
5146
%}
5247

48+
%option 8bit
49+
%option never-interactive
50+
%option nounput
51+
%option noyywrap
52+
53+
5354
SIGN ("-"|"+")
5455
DIGIT [0-9]
5556
HEXDIGIT [0-9a-fA-F]
@@ -271,12 +272,6 @@ ProcessConfigFile(GucContext context)
271272

272273

273274

274-
int
275-
yywrap(void)
276-
{
277-
return 1;
278-
}
279-
280275
/* ----------------
281276
* scanstr
282277
*

src/interfaces/ecpg/preproc/pgc.l

+7-14
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
*
1414
* IDENTIFICATION
15-
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.97 2002/07/20 08:24:18 meskes Exp $
15+
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.98 2002/07/30 16:33:08 tgl Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -26,12 +26,6 @@
2626
#include "extern.h"
2727
#include "preproc.h"
2828

29-
/* some versions of lex define this as a macro */
30-
#if defined(yywrap)
31-
#undef yywrap
32-
#endif /* yywrap */
33-
34-
#define YY_NO_UNPUT
3529

3630
extern YYSTYPE yylval;
3731

@@ -75,7 +69,13 @@ static struct _if_value
7569

7670
%}
7771

72+
%option 8bit
73+
%option never-interactive
74+
%option nounput
75+
%option noyywrap
76+
7877
%option yylineno
78+
7979
%s C SQL incl def def_ident
8080

8181
/*
@@ -945,10 +945,3 @@ addlitchar(unsigned char ychar)
945945
literallen += 1;
946946
literalbuf[literallen] = '\0';
947947
}
948-
949-
int
950-
yywrap(void)
951-
{
952-
return(1);
953-
}
954-

src/pl/plpgsql/src/scan.l

+6-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* procedural language
55
*
66
* IDENTIFICATION
7-
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/scan.l,v 1.17 2002/03/06 18:50:29 momjian Exp $
7+
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/scan.l,v 1.18 2002/07/30 16:33:08 tgl Exp $
88
*
99
* This software is copyrighted by Jan Wieck - Hamburg.
1010
*
@@ -52,9 +52,13 @@ int plpgsql_SpaceScanned = 0;
5252
static void plpgsql_input(char *buf, int *result, int max);
5353

5454
#define YY_INPUT(buf,res,max) plpgsql_input(buf, &res, max)
55-
#define YY_NO_UNPUT
5655
%}
5756

57+
%option 8bit
58+
%option never-interactive
59+
%option nounput
60+
%option noyywrap
61+
5862
%option yylineno
5963

6064

@@ -215,12 +219,6 @@ dump { return O_DUMP; }
215219

216220
%%
217221

218-
int
219-
yywrap()
220-
{
221-
return 1;
222-
}
223-
224222

225223
static void
226224
plpgsql_input(char *buf, int *result, int max)

0 commit comments

Comments
 (0)