summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorTom Lane2006-03-07 01:03:12 +0000
committerTom Lane2006-03-07 01:03:12 +0000
commitfb51ad3419ea84d7ad23edbc931e1b575c803e2a (patch)
treea6bed06804d3ea14f05c0b9cd9ae45423faf4413 /contrib
parent012abebab1bc72043f3f670bf32e91ae4ee04bd2 (diff)
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.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/cube/Makefile6
-rw-r--r--contrib/cube/cubeparse.y7
-rw-r--r--contrib/seg/Makefile7
-rw-r--r--contrib/seg/segparse.y8
4 files changed, 16 insertions, 12 deletions
diff --git a/contrib/cube/Makefile b/contrib/cube/Makefile
index e1b9f14244e..0b43cfa2400 100644
--- a/contrib/cube/Makefile
+++ b/contrib/cube/Makefile
@@ -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
diff --git a/contrib/cube/cubeparse.y b/contrib/cube/cubeparse.y
index 470045e9077..9756b508aa5 100644
--- a/contrib/cube/cubeparse.y
+++ b/contrib/cube/cubeparse.y
@@ -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
diff --git a/contrib/seg/Makefile b/contrib/seg/Makefile
index d40bf42c6e0..7c1c631a00f 100644
--- a/contrib/seg/Makefile
+++ b/contrib/seg/Makefile
@@ -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
diff --git a/contrib/seg/segparse.y b/contrib/seg/segparse.y
index 8a3b0b0160c..d4d739c621c 100644
--- a/contrib/seg/segparse.y
+++ b/contrib/seg/segparse.y
@@ -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;