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

Commit 9d00798

Browse files
committed
Tweak bison build rules so that we get the same error messages from
bison 1.875 and later as we did from earlier bison releases. Eventually we will probably want to adopt the newer message spelling ... but not yet. Per recent discussion on pgpatches. Note: I didn't change the build rules for bootstrap, ecpg, or plpgsql grammars, since these do not affect regression test results.
1 parent bd96dd1 commit 9d00798

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

contrib/cube/Makefile

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Header: /cvsroot/pgsql/contrib/cube/Makefile,v 1.7 2002/11/01 22:52:33 tgl Exp $
1+
# $Header: /cvsroot/pgsql/contrib/cube/Makefile,v 1.8 2003/01/31 20:58:00 tgl Exp $
22

33
subdir = contrib/cube
44
top_builddir = ../..
@@ -17,11 +17,17 @@ cubeparse.o: cubescan.c
1717

1818
cubeparse.c: cubeparse.h ;
1919

20+
# The sed hack is so that we can get the same error messages with
21+
# bison 1.875 and later as we did with earlier bisons. Eventually,
22+
# I suppose, we should re-standardize on "syntax error" --- in which
23+
# case flip the sed translation, but don't remove it.
24+
2025
cubeparse.h: cubeparse.y
2126
ifdef YACC
2227
$(YACC) -d $(YFLAGS) -p cube_yy $<
23-
mv -f y.tab.c cubeparse.c
28+
sed -e 's/"syntax error/"parse error/' < y.tab.c > cubeparse.c
2429
mv -f y.tab.h cubeparse.h
30+
rm -f y.tab.c
2531
else
2632
@$(missing) bison $< $@
2733
endif

contrib/seg/Makefile

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Header: /cvsroot/pgsql/contrib/seg/Makefile,v 1.7 2002/11/01 22:52:33 tgl Exp $
1+
# $Header: /cvsroot/pgsql/contrib/seg/Makefile,v 1.8 2003/01/31 20:58:00 tgl Exp $
22

33
subdir = contrib/seg
44
top_builddir = ../..
@@ -16,11 +16,17 @@ segparse.o: segscan.c
1616

1717
segparse.c: segparse.h ;
1818

19+
# The sed hack is so that we can get the same error messages with
20+
# bison 1.875 and later as we did with earlier bisons. Eventually,
21+
# I suppose, we should re-standardize on "syntax error" --- in which
22+
# case flip the sed translation, but don't remove it.
23+
1924
segparse.h: segparse.y
2025
ifdef YACC
2126
$(YACC) -d $(YFLAGS) -p seg_yy $<
22-
mv -f y.tab.c segparse.c
27+
sed -e 's/"syntax error/"parse error/' < y.tab.c > segparse.c
2328
mv -f y.tab.h segparse.h
29+
rm -f y.tab.c
2430
else
2531
@$(missing) bison $< $@
2632
endif

src/backend/parser/Makefile

+8-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Makefile for parser
44
#
5-
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.38 2002/11/01 22:52:33 tgl Exp $
5+
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.39 2003/01/31 20:58:00 tgl Exp $
66
#
77
#-------------------------------------------------------------------------
88

@@ -38,11 +38,17 @@ gram.o: $(srcdir)/scan.c
3838

3939
$(srcdir)/gram.c: $(srcdir)/parse.h ;
4040

41+
# The sed hack is so that we can get the same error messages with
42+
# bison 1.875 and later as we did with earlier bisons. Eventually,
43+
# I suppose, we should re-standardize on "syntax error" --- in which
44+
# case flip the sed translation, but don't remove it.
45+
4146
$(srcdir)/parse.h: gram.y
4247
ifdef YACC
4348
$(YACC) -d $(YFLAGS) $<
44-
mv -f y.tab.c $(srcdir)/gram.c
49+
sed -e 's/"syntax error/"parse error/' < y.tab.c > $(srcdir)/gram.c
4550
mv -f y.tab.h $(srcdir)/parse.h
51+
rm -f y.tab.c
4652
else
4753
@$(missing) bison $< $@
4854
endif

0 commit comments

Comments
 (0)