1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

Make all our flex and bison files use %option prefix or %name-prefix

(respectively) to rename yylex and related symbols.  Some were doing
it this way already, while others used not-too-reliable sed hacks in
the Makefiles.  It's all nice and consistent now.
This commit is contained in:
Tom Lane
2006-03-07 01:03:12 +00:00
parent 012abebab1
commit fb51ad3419
16 changed files with 65 additions and 69 deletions

View File

@ -1,4 +1,4 @@
# $PostgreSQL: pgsql/contrib/cube/Makefile,v 1.16 2006/02/27 12:54:38 petere Exp $
# $PostgreSQL: pgsql/contrib/cube/Makefile,v 1.17 2006/03/07 01:03:12 tgl Exp $
MODULE_big = cube
OBJS= cube.o cubeparse.o
@ -28,11 +28,13 @@ endif
# cubescan is compiled as part of cubeparse
cubeparse.o: cubescan.c
# See notes in src/backend/parser/Makefile about the following two rules
cubeparse.c: cubeparse.h ;
cubeparse.h: cubeparse.y
ifdef YACC
$(YACC) -d $(YFLAGS) -p cube_yy $<
$(YACC) -d $(YFLAGS) $<
mv -f y.tab.c cubeparse.c
mv -f y.tab.h cubeparse.h
else

View File

@ -10,10 +10,7 @@
#include "cubedata.h"
#undef yylex /* failure to redefine yylex will result in a call to the */
#define yylex cube_yylex /* wrong scanner when running inside the postgres backend */
extern int yylex(void); /* defined as cube_yylex in cubescan.l */
extern int cube_yylex(void);
static char *scanbuf;
static int scanbuflen;
@ -28,6 +25,8 @@ static NDBOX * write_point_as_box(char *s, int dim);
%}
/* BISON Declarations */
%name-prefix="cube_yy"
%token CUBEFLOAT O_PAREN C_PAREN O_BRACKET C_BRACKET COMMA
%start box

View File

@ -1,4 +1,4 @@
# $PostgreSQL: pgsql/contrib/seg/Makefile,v 1.15 2006/02/27 12:54:39 petere Exp $
# $PostgreSQL: pgsql/contrib/seg/Makefile,v 1.16 2006/03/07 01:03:12 tgl Exp $
MODULE_big = seg
OBJS = seg.o segparse.o
@ -21,14 +21,17 @@ include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
endif
# segscan is compiled as part of segparse
segparse.o: segscan.c
# See notes in src/backend/parser/Makefile about the following two rules
segparse.c: segparse.h ;
segparse.h: segparse.y
ifdef YACC
$(YACC) -d $(YFLAGS) -p seg_yy $<
$(YACC) -d $(YFLAGS) $<
mv -f y.tab.c segparse.c
mv -f y.tab.h segparse.h
else

View File

@ -9,14 +9,12 @@
#include "utils/builtins.h"
#include "segdata.h"
#undef yylex /* failure to redefine yylex will result in calling the */
#define yylex seg_yylex /* wrong scanner when running inside postgres backend */
extern int seg_yylex(void);
extern int yylex(void); /* defined as seg_yylex in segscan.l */
extern int significant_digits( char *str ); /* defined in seg.c */
void seg_yyerror(const char *message);
int seg_yyparse( void *result );
int seg_yyparse(void *result);
float seg_atof( char *value );
@ -32,6 +30,8 @@
%}
/* BISON Declarations */
%name-prefix="seg_yy"
%union {
struct BND {
float val;