Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9f1fc10

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 fileshave a consistent set of options.
1 parent7478059 commit9f1fc10

File tree

7 files changed

+45
-56
lines changed

7 files changed

+45
-56
lines changed

‎contrib/cube/cubescan.l

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
#include"cubeparse.h"
1111
#include"buffer.h"
1212

13-
#defineYY_NO_UNPUT1
14-
#undef yywrap
1513

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

29+
%option8bit
30+
%optionnever-interactive
31+
%optionnounput
32+
%optionnoyywrap
33+
34+
3135
n [0-9]+
3236
integer [+-]?{n}
3337
real [+-]?({n}\.{n}?)|(\.{n})

‎contrib/seg/segscan.l

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
#include"segparse.h"
99
#include"buffer.h"
1010

11-
#defineYY_NO_UNPUT1
12-
#undef yywrap
1311

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

28+
%option8bit
29+
%optionnever-interactive
30+
%optionnounput
31+
%optionnoyywrap
32+
33+
3034
range (\.\.)(\.)?
3135
plumin (\'\+\-\')|(\(\+\-)\)
3236
integer [+-]?[0-9]+

‎contrib/tsearch/parser.l

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

53-
#defineYY_NO_UNPUT
5453
%}
5554

55+
%option8bit
56+
%optionnever-interactive
57+
%optionnounput
58+
%optionnoyywrap
59+
60+
5661
/* parser's state for parsing defis-word */
5762
%xDELIM
5863
/* parser's state for parsing URL*/
@@ -289,10 +294,6 @@ ftp"://" {
289294

290295
%%
291296

292-
inttsearch_yywrap(void) {
293-
return1;
294-
}
295-
296297
/* clearing after parsing from string */
297298
voidend_parse() {
298299
if (s) {free(s); s=NULL; }

‎src/backend/bootstrap/bootscanner.l

Lines changed: 7 additions & 13 deletions
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-
#defineYY_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
intyyline;/* keep track of the line number for error reporting*/
5448

5549
%}
5650

51+
%option8bit
52+
%optionnever-interactive
53+
%optionnounput
54+
%optionnoyywrap
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-
return1;
139-
}
140-
141135
void
142136
yyerror(constchar *str)
143137
{

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

Lines changed: 7 additions & 12 deletions
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
#defineYY_USER_INIT (ConfigFileLineno =1)
46-
#defineYY_NO_UNPUT
4742

4843
/* prototype, so compiler is happy with our high warnings setting */
4944
intGUC_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-
return1;
278-
}
279-
280275
/* ----------------
281276
*scanstr
282277
*

‎src/interfaces/ecpg/preproc/pgc.l

Lines changed: 7 additions & 14 deletions
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-
#defineYY_NO_UNPUT
3529

3630
extern YYSTYPE yylval;
3731

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

7670
%}
7771

72+
%option8bit
73+
%optionnever-interactive
74+
%optionnounput
75+
%optionnoyywrap
76+
7877
%optionyylineno
78+
7979
%sCSQLincldefdef_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

Lines changed: 6 additions & 8 deletions
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 @@ intplpgsql_SpaceScanned = 0;
5252
staticvoidplpgsql_input(char *buf,int *result,int max);
5353

5454
#defineYY_INPUT(buf,res,max)plpgsql_input(buf, &res, max)
55-
#defineYY_NO_UNPUT
5655
%}
5756

57+
%option8bit
58+
%optionnever-interactive
59+
%optionnounput
60+
%optionnoyywrap
61+
5862
%optionyylineno
5963

6064

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

216220
%%
217221

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

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp