Build all Flex files standalone
authorJohn Naylor <john.naylor@postgresql.org>
Sun, 4 Sep 2022 04:33:31 +0000 (11:33 +0700)
committerJohn Naylor <john.naylor@postgresql.org>
Sun, 4 Sep 2022 05:09:01 +0000 (12:09 +0700)
The proposed Meson build system will need a way to ignore certain
generated files in order to coexist with the autoconf build system,
and C files generated by Flex which are #include'd into .y files make
this more difficult. In similar vein to 72b1e3a21, arrange for all Flex
C files to compile to their own .o targets.

Reviewed by Andres Freund

Discussion: https://www.postgresql.org/message-id/20220810171935.7k5zgnjwqzalzmtm%40awork3.anarazel.de
Discussion: https://www.postgresql.org/message-id/CAFBsxsF8Gc2StS3haXofshHCzqNMRXiSxvQEYGwnFsTmsdwNeg@mail.gmail.com

38 files changed:
contrib/cube/.gitignore
contrib/cube/Makefile
contrib/cube/cube.c
contrib/cube/cubedata.h
contrib/cube/cubeparse.y
contrib/cube/cubescan.l
contrib/seg/.gitignore
contrib/seg/Makefile
contrib/seg/segparse.y
contrib/seg/segscan.l
src/backend/Makefile
src/backend/bootstrap/.gitignore
src/backend/bootstrap/Makefile
src/backend/bootstrap/bootparse.y
src/backend/bootstrap/bootscanner.l
src/backend/replication/.gitignore
src/backend/replication/Makefile
src/backend/replication/repl_gram.y
src/backend/replication/repl_scanner.l
src/backend/replication/syncrep_gram.y
src/backend/replication/syncrep_scanner.l
src/backend/utils/adt/.gitignore
src/backend/utils/adt/Makefile
src/backend/utils/adt/jsonpath_gram.y
src/backend/utils/adt/jsonpath_internal.h [new file with mode: 0644]
src/backend/utils/adt/jsonpath_scan.l
src/backend/utils/misc/Makefile
src/backend/utils/misc/guc-file.l
src/backend/utils/misc/guc.c
src/bin/pgbench/.gitignore
src/bin/pgbench/Makefile
src/bin/pgbench/exprparse.y
src/bin/pgbench/exprscan.l
src/test/isolation/.gitignore
src/test/isolation/Makefile
src/test/isolation/specparse.y
src/test/isolation/specscanner.l
src/tools/pginclude/headerscheck

index cb4c989fff10a0eb593fda8f9c90be57a7d8b26a..f788440c796b863b5a712182596e34138755cf5d 100644 (file)
@@ -1,3 +1,4 @@
+/cubeparse.h
 /cubeparse.c
 /cubescan.c
 # Generated subdirectories
index cf195506c717c55c680a0210bb154a8ea8a064a4..4fd19aac359faf72458f4da89139fd157a5937c2 100644 (file)
@@ -4,7 +4,8 @@ MODULE_big = cube
 OBJS = \
        $(WIN32RES) \
        cube.o \
-       cubeparse.o
+       cubeparse.o \
+       cubescan.o
 
 EXTENSION = cube
 DATA = cube--1.2.sql cube--1.2--1.3.sql cube--1.3--1.4.sql cube--1.4--1.5.sql \
@@ -15,8 +16,6 @@ HEADERS = cubedata.h
 
 REGRESS = cube cube_sci
 
-EXTRA_CLEAN = y.tab.c y.tab.h
-
 SHLIB_LINK += $(filter -lm, $(LIBS))
 
 ifdef USE_PGXS
@@ -30,11 +29,16 @@ include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
 endif
 
+# See notes in src/backend/parser/Makefile about the following two rules
+cubeparse.h: cubeparse.c
+       touch $@
+
+cubeparse.c: BISONFLAGS += -d
 
-# cubescan is compiled as part of cubeparse
-cubeparse.o: cubescan.c
+# Force these dependencies to be known even without dependency info built:
+cubeparse.o cubescan.o: cubeparse.h
 
 distprep: cubeparse.c cubescan.c
 
 maintainer-clean:
-       rm -f cubeparse.c cubescan.c
+       rm -f cubeparse.h cubeparse.c cubescan.c
index a5d1ba6733528ab772515685a6f6b14c2f99903a..6e01800a4a87aa08ea912b5dde339c9bea95c025 100644 (file)
@@ -119,11 +119,11 @@ cube_in(PG_FUNCTION_ARGS)
 {
        char       *str = PG_GETARG_CSTRING(0);
        NDBOX      *result;
+       Size            scanbuflen;
 
-       cube_scanner_init(str);
+       cube_scanner_init(str, &scanbuflen);
 
-       if (cube_yyparse(&result) != 0)
-               cube_yyerror(&result, "cube parser failed");
+       cube_yyparse(&result, scanbuflen);
 
        cube_scanner_finish();
 
index dbe7d4f7429a6baaf6e3b7e3f6f739b9225fdf3f..640a7ca5800ecc88db3a9b8f36d2654b00b0d7e6 100644 (file)
@@ -61,9 +61,9 @@ typedef struct NDBOX
 
 /* in cubescan.l */
 extern int     cube_yylex(void);
-extern void cube_yyerror(NDBOX **result, const char *message) pg_attribute_noreturn();
-extern void cube_scanner_init(const char *str);
+extern void cube_yyerror(NDBOX **result, Size scanbuflen, const char *message) pg_attribute_noreturn();
+extern void cube_scanner_init(const char *str, Size *scanbuflen);
 extern void cube_scanner_finish(void);
 
 /* in cubeparse.y */
-extern int     cube_yyparse(NDBOX **result);
+extern int     cube_yyparse(NDBOX **result, Size scanbuflen);
index 7577c4515c645c36f66780c98b3e5891d69c4eb9..6cceae8e996904e51315f18791a6adbe878fdd7f 100644 (file)
@@ -23,9 +23,6 @@
 #define YYMALLOC palloc
 #define YYFREE   pfree
 
-static char *scanbuf;
-static int     scanbuflen;
-
 static int item_count(const char *s, char delim);
 static NDBOX *write_box(int dim, char *str1, char *str2);
 static NDBOX *write_point_as_box(int dim, char *str);
@@ -34,6 +31,7 @@ static NDBOX *write_point_as_box(int dim, char *str);
 
 /* BISON Declarations */
 %parse-param {NDBOX **result}
+%parse-param {Size scanbuflen}
 %expect 0
 %name-prefix="cube_yy"
 
@@ -265,5 +263,3 @@ write_point_as_box(int dim, char *str)
 
        return bp;
 }
-
-#include "cubescan.c"
index bd400e36842917ba3fbd0f2ef98428057409b316..6b316f2d5457b9c9e1308858dcd8aac826e4fb06 100644 (file)
@@ -1,9 +1,21 @@
-%{
+%top{
 /*
  * A scanner for EMP-style numeric ranges
  * contrib/cube/cubescan.l
  */
 
+#include "postgres.h"
+
+/*
+ * NB: include cubeparse.h only AFTER defining YYSTYPE (to match cubeparse.y)
+ * and cubedata.h for NDBOX.
+ */
+#include "cubedata.h"
+#define YYSTYPE char *
+#include "cubeparse.h"
+}
+
+%{
 /* LCOV_EXCL_START */
 
 /* No reason to constrain amount of data slurped */
@@ -21,9 +33,7 @@ fprintf_to_ereport(const char *fmt, const char *msg)
 
 /* Handles to the buffer that the lexer uses internally */
 static YY_BUFFER_STATE scanbufhandle;
-/* this is now declared in cubeparse.y: */
-/* static char *scanbuf; */
-/* static int  scanbuflen; */
+static char *scanbuf;
 %}
 
 %option 8bit
@@ -45,14 +55,14 @@ NaN          [nN][aA][nN]
 
 %%
 
-{float}      yylval = yytext; return CUBEFLOAT;
-{infinity}   yylval = yytext; return CUBEFLOAT;
-{NaN}        yylval = yytext; return CUBEFLOAT;
-\[           yylval = "("; return O_BRACKET;
-\]           yylval = ")"; return C_BRACKET;
-\(           yylval = "("; return O_PAREN;
-\)           yylval = ")"; return C_PAREN;
-\,           yylval = ","; return COMMA;
+{float}      cube_yylval = yytext; return CUBEFLOAT;
+{infinity}   cube_yylval = yytext; return CUBEFLOAT;
+{NaN}        cube_yylval = yytext; return CUBEFLOAT;
+\[           cube_yylval = "("; return O_BRACKET;
+\]           cube_yylval = ")"; return C_BRACKET;
+\(           cube_yylval = "("; return O_PAREN;
+\)           cube_yylval = ")"; return C_PAREN;
+\,           cube_yylval = ","; return COMMA;
 [ \t\n\r\f]+ /* discard spaces */
 .            return yytext[0]; /* alert parser of the garbage */
 
@@ -60,9 +70,9 @@ NaN          [nN][aA][nN]
 
 /* LCOV_EXCL_STOP */
 
-/* result is not used, but Bison expects this signature */
+/* result and scanbuflen are not used, but Bison expects this signature */
 void
-yyerror(NDBOX **result, const char *message)
+cube_yyerror(NDBOX **result, Size scanbuflen, const char *message)
 {
        if (*yytext == YY_END_OF_BUFFER_CHAR)
        {
@@ -87,9 +97,9 @@ yyerror(NDBOX **result, const char *message)
  * Called before any actual parsing is done
  */
 void
-cube_scanner_init(const char *str)
+cube_scanner_init(const char *str, Size *scanbuflen)
 {
-       Size    slen = strlen(str);
+       Size            slen = strlen(str);
 
        /*
         * Might be left over after ereport()
@@ -100,7 +110,7 @@ cube_scanner_init(const char *str)
        /*
         * Make a scan buffer with special termination needed by flex.
         */
-       scanbuflen = slen;
+       *scanbuflen = slen;
        scanbuf = palloc(slen + 2);
        memcpy(scanbuf, str, slen);
        scanbuf[slen] = scanbuf[slen + 1] = YY_END_OF_BUFFER_CHAR;
index 69e73d20966bca15624527edd09e258c23f75ecb..fa247a4e67b0d0c93526e0bcdf5b28502a53b107 100644 (file)
@@ -1,3 +1,4 @@
+/segparse.h
 /segparse.c
 /segscan.c
 # Generated subdirectories
index bb63e835067f42e25404a0618f2c33ca04ee9091..c6c134b8f15eaed0cfda8eab52322ca9117633da 100644 (file)
@@ -4,7 +4,8 @@ MODULE_big = seg
 OBJS = \
        $(WIN32RES) \
        seg.o \
-       segparse.o
+       segparse.o \
+       segscan.o
 
 EXTENSION = seg
 DATA = seg--1.1.sql seg--1.1--1.2.sql seg--1.2--1.3.sql seg--1.3--1.4.sql \
@@ -29,10 +30,16 @@ 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.h: segparse.c
+       touch $@
+
+segparse.c: BISONFLAGS += -d
+
+# Force these dependencies to be known even without dependency info built:
+segparse.o segscan.o: segparse.h
 
 distprep: segparse.c segscan.c
 
 maintainer-clean:
-       rm -f segparse.c segscan.c
+       rm -f segparse.h segparse.c segscan.c
index 33e3a9f35f25eff847b1204b8850a5a63c7fc90c..637eacd1a65d1107b7f015d711e5aeadae21cdd7 100644 (file)
@@ -160,6 +160,3 @@ seg_atof(const char *value)
        datum = DirectFunctionCall1(float4in, CStringGetDatum(value));
        return DatumGetFloat4(datum);
 }
-
-
-#include "segscan.c"
index 5f6595e9eb25b38c03f4eac065609ca51e5dee05..4744fd5e9e84592520b374a400da71ca1b4f90a0 100644 (file)
@@ -1,8 +1,18 @@
-%{
+%top{
 /*
  * A scanner for EMP-style numeric ranges
  */
+#include "postgres.h"
+
+/*
+ * NB: include segparse.h only AFTER including segdata.h, because segdata.h
+ * contains the definition for SEG.
+ */
+#include "segdata.h"
+#include "segparse.h"
+}
 
+%{
 /* LCOV_EXCL_START */
 
 /* No reason to constrain amount of data slurped */
@@ -21,7 +31,6 @@ fprintf_to_ereport(const char *fmt, const char *msg)
 /* Handles to the buffer that the lexer uses internally */
 static YY_BUFFER_STATE scanbufhandle;
 static char *scanbuf;
-static int     scanbuflen;
 %}
 
 %option 8bit
@@ -42,12 +51,12 @@ float        ({integer}|{real})([eE]{integer})?
 
 %%
 
-{range}      yylval.text = yytext; return RANGE;
-{plumin}     yylval.text = yytext; return PLUMIN;
-{float}      yylval.text = yytext; return SEGFLOAT;
-\<           yylval.text = "<"; return EXTENSION;
-\>           yylval.text = ">"; return EXTENSION;
-\~           yylval.text = "~"; return EXTENSION;
+{range}      seg_yylval.text = yytext; return RANGE;
+{plumin}     seg_yylval.text = yytext; return PLUMIN;
+{float}      seg_yylval.text = yytext; return SEGFLOAT;
+\<           seg_yylval.text = "<"; return EXTENSION;
+\>           seg_yylval.text = ">"; return EXTENSION;
+\~           seg_yylval.text = "~"; return EXTENSION;
 [ \t\n\r\f]+ /* discard spaces */
 .            return yytext[0]; /* alert parser of the garbage */
 
@@ -56,7 +65,7 @@ float        ({integer}|{real})([eE]{integer})?
 /* LCOV_EXCL_STOP */
 
 void
-yyerror(SEG *result, const char *message)
+seg_yyerror(SEG *result, const char *message)
 {
        if (*yytext == YY_END_OF_BUFFER_CHAR)
        {
@@ -94,7 +103,6 @@ seg_scanner_init(const char *str)
        /*
         * Make a scan buffer with special termination needed by flex.
         */
-       scanbuflen = slen;
        scanbuf = palloc(slen + 2);
        memcpy(scanbuf, str, slen);
        scanbuf[slen] = scanbuf[slen + 1] = YY_END_OF_BUFFER_CHAR;
index f498cfd593091adfd04b3bd35ddae50002b30ed7..4ac9f8f180e5e60436920cb2c56a46dbcf000813 100644 (file)
@@ -174,10 +174,10 @@ utils/probes.o: utils/probes.d $(SUBDIROBJS)
 # Be sure that these files get removed by the maintainer-clean target
 distprep:
        $(MAKE) -C parser       gram.c gram.h scan.c
-       $(MAKE) -C bootstrap    bootparse.c bootscanner.c
+       $(MAKE) -C bootstrap    bootparse.c bootparse.h bootscanner.c
        $(MAKE) -C catalog      distprep
        $(MAKE) -C nodes        distprep
-       $(MAKE) -C replication  repl_gram.c repl_scanner.c syncrep_gram.c syncrep_scanner.c
+       $(MAKE) -C replication  repl_gram.c repl_gram.h repl_scanner.c syncrep_gram.c syncrep_gram.h syncrep_scanner.c
        $(MAKE) -C storage/lmgr lwlocknames.h lwlocknames.c
        $(MAKE) -C utils        distprep
        $(MAKE) -C utils/adt    jsonpath_gram.c jsonpath_scan.c
@@ -292,13 +292,16 @@ maintainer-clean: distclean
        $(MAKE) -C nodes $@
        $(MAKE) -C utils $@
        rm -f bootstrap/bootparse.c \
+             bootstrap/bootparse.h \
              bootstrap/bootscanner.c \
              parser/gram.c \
              parser/gram.h \
              parser/scan.c \
              replication/repl_gram.c \
+             replication/repl_gram.h \
              replication/repl_scanner.c \
              replication/syncrep_gram.c \
+             replication/syncrep_gram.h \
              replication/syncrep_scanner.c \
              storage/lmgr/lwlocknames.c \
              storage/lmgr/lwlocknames.h \
index 1ffe8ca39edfd6b10200577f89fa12bc001d1f99..6351b920fd6b712415f22d9cfa33cf71eb8fd0ba 100644 (file)
@@ -1,2 +1,3 @@
+/bootparse.h
 /bootparse.c
 /bootscanner.c
index 6421efb2270bd1b3c1932f3479dafca52fc63031..606c8021e766b8e361e1894b827a38a0a18818a1 100644 (file)
@@ -14,12 +14,19 @@ override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS)
 
 OBJS = \
        bootparse.o \
+       bootscanner.o \
        bootstrap.o
 
 include $(top_srcdir)/src/backend/common.mk
 
-# bootscanner is compiled as part of bootparse
-bootparse.o: bootscanner.c
+# See notes in src/backend/parser/Makefile about the following two rules
+bootparse.h: bootparse.c
+       touch $@
+
+bootparse.c: BISONFLAGS += -d
+
+# Force these dependencies to be known even without dependency info built:
+bootparse.o bootscanner.o: bootparse.h
 
 # bootparse.c and bootscanner.c are in the distribution tarball, so
 # they are not cleaned here.
index 7d7655d2956e97ee4e1594a4e843df3d1e1521d4..c45ddde67f2b15138021b4c63d6cee977b015c36 100644 (file)
@@ -488,5 +488,3 @@ boot_ident:
                | XNULL                 { $$ = pstrdup($1); }
                ;
 %%
-
-#include "bootscanner.c"
index 3094ccb93f4e03a17a309a55289ef99f08dc0455..d6eae84816bef9a3a6e0788931c6e2d841ed036e 100644 (file)
@@ -1,4 +1,4 @@
-%{
+%top{
 /*-------------------------------------------------------------------------
  *
  * bootscanner.l
  */
 #include "postgres.h"
 
+/*
+ * NB: include bootparse.h only AFTER including bootstrap.h, because bootstrap.h
+ * includes node definitions needed for YYSTYPE.
+ */
 #include "bootstrap/bootstrap.h"
+#include "bootparse.h"
 #include "utils/guc.h"
 
-/* Not needed now that this file is compiled as part of bootparse. */
-/* #include "bootparse.h" */
+}
+
+%{
 
 /* LCOV_EXCL_START */
 
@@ -52,7 +58,7 @@ id            [-A-Za-z0-9_]+
 sid            \'([^']|\'\')*\'
 
 /*
- * Keyword tokens return the keyword text (as a constant string) in yylval.kw,
+ * Keyword tokens return the keyword text (as a constant string) in boot_yylval.kw,
  * just in case that's needed because we want to treat the keyword as an
  * unreserved identifier.  Note that _null_ is not treated as a keyword
  * for this purpose; it's the one "reserved word" in the bootstrap syntax.
@@ -60,23 +66,23 @@ sid         \'([^']|\'\')*\'
  * Notice that all the keywords are case-sensitive, and for historical
  * reasons some must be upper case.
  *
- * String tokens return a palloc'd string in yylval.str.
+ * String tokens return a palloc'd string in boot_yylval.str.
  */
 
 %%
 
-open                   { yylval.kw = "open"; return OPEN; }
+open                   { boot_yylval.kw = "open"; return OPEN; }
 
-close                  { yylval.kw = "close"; return XCLOSE; }
+close                  { boot_yylval.kw = "close"; return XCLOSE; }
 
-create                 { yylval.kw = "create"; return XCREATE; }
+create                 { boot_yylval.kw = "create"; return XCREATE; }
 
-OID                            { yylval.kw = "OID"; return OBJ_ID; }
-bootstrap              { yylval.kw = "bootstrap"; return XBOOTSTRAP; }
-shared_relation        { yylval.kw = "shared_relation"; return XSHARED_RELATION; }
-rowtype_oid            { yylval.kw = "rowtype_oid"; return XROWTYPE_OID; }
+OID                            { boot_yylval.kw = "OID"; return OBJ_ID; }
+bootstrap              { boot_yylval.kw = "bootstrap"; return XBOOTSTRAP; }
+shared_relation        { boot_yylval.kw = "shared_relation"; return XSHARED_RELATION; }
+rowtype_oid            { boot_yylval.kw = "rowtype_oid"; return XROWTYPE_OID; }
 
-insert                 { yylval.kw = "insert"; return INSERT_TUPLE; }
+insert                 { boot_yylval.kw = "insert"; return INSERT_TUPLE; }
 
 _null_                 { return NULLVAL; }
 
@@ -90,25 +96,25 @@ _null_                      { return NULLVAL; }
 
 ^\#[^\n]*              ;               /* drop everything after "#" for comments */
 
-declare                        { yylval.kw = "declare"; return XDECLARE; }
-build                  { yylval.kw = "build"; return XBUILD; }
-indices                        { yylval.kw = "indices"; return INDICES; }
-unique                 { yylval.kw = "unique"; return UNIQUE; }
-index                  { yylval.kw = "index"; return INDEX; }
-on                             { yylval.kw = "on"; return ON; }
-using                  { yylval.kw = "using"; return USING; }
-toast                  { yylval.kw = "toast"; return XTOAST; }
-FORCE                  { yylval.kw = "FORCE"; return XFORCE; }
-NOT                            { yylval.kw = "NOT"; return XNOT; }
-NULL                   { yylval.kw = "NULL"; return XNULL; }
+declare                        { boot_yylval.kw = "declare"; return XDECLARE; }
+build                  { boot_yylval.kw = "build"; return XBUILD; }
+indices                        { boot_yylval.kw = "indices"; return INDICES; }
+unique                 { boot_yylval.kw = "unique"; return UNIQUE; }
+index                  { boot_yylval.kw = "index"; return INDEX; }
+on                             { boot_yylval.kw = "on"; return ON; }
+using                  { boot_yylval.kw = "using"; return USING; }
+toast                  { boot_yylval.kw = "toast"; return XTOAST; }
+FORCE                  { boot_yylval.kw = "FORCE"; return XFORCE; }
+NOT                            { boot_yylval.kw = "NOT"; return XNOT; }
+NULL                   { boot_yylval.kw = "NULL"; return XNULL; }
 
 {id}                   {
-                                       yylval.str = pstrdup(yytext);
+                                       boot_yylval.str = pstrdup(yytext);
                                        return ID;
                                }
 {sid}                  {
                                        /* strip quotes and escapes */
-                                       yylval.str = DeescapeQuotedString(yytext);
+                                       boot_yylval.str = DeescapeQuotedString(yytext);
                                        return ID;
                                }
 
@@ -121,7 +127,7 @@ NULL                        { yylval.kw = "NULL"; return XNULL; }
 /* LCOV_EXCL_STOP */
 
 void
-yyerror(const char *message)
+boot_yyerror(const char *message)
 {
        elog(ERROR, "%s at line %d", message, yyline);
 }
index d1df6147bd0b9d3594fee8037eced46e4ff61107..77d5a51068dff58066285a9d9dbd3f77d2c0e63e 100644 (file)
@@ -1,4 +1,6 @@
+/repl_gram.h
 /repl_gram.c
 /repl_scanner.c
+/syncrep_gram.h
 /syncrep_gram.c
 /syncrep_scanner.c
index 2bffac58c0d5891ee29e53e42c3d257cff59167f..23f29ba5457547bd553919312cfbcb1ebbda7774 100644 (file)
@@ -16,10 +16,12 @@ override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS)
 
 OBJS = \
        repl_gram.o \
+       repl_scanner.o \
        slot.o \
        slotfuncs.o \
        syncrep.o \
        syncrep_gram.o \
+       syncrep_scanner.o \
        walreceiver.o \
        walreceiverfuncs.o \
        walsender.o
@@ -28,11 +30,23 @@ SUBDIRS = logical
 
 include $(top_srcdir)/src/backend/common.mk
 
-# repl_scanner is compiled as part of repl_gram
-repl_gram.o: repl_scanner.c
+# See notes in src/backend/parser/Makefile about the following two rules
+repl_gram.h: repl_gram.c
+       touch $@
 
-# syncrep_scanner is compiled as part of syncrep_gram
-syncrep_gram.o: syncrep_scanner.c
+repl_gram.c: BISONFLAGS += -d
+
+# Force these dependencies to be known even without dependency info built:
+repl_gram.o repl_scanner.o: repl_gram.h
+
+# See notes in src/backend/parser/Makefile about the following two rules
+syncrep_gram.h: syncrep_gram.c
+       touch $@
+
+syncrep_gram.c: BISONFLAGS += -d
+
+# Force these dependencies to be known even without dependency info built:
+syncrep_gram.o syncrep_scanner.o: syncrep_gram.h
 
 # repl_gram.c, repl_scanner.c, syncrep_gram.c and syncrep_scanner.c
 # are in the distribution tarball, so they are not cleaned here.
index 4cf087e602e182a50175259b02f0d61d7f353448..b343f108d3158829be5070d5278fd3c8c331e82e 100644 (file)
@@ -416,5 +416,3 @@ ident_or_keyword:
                ;
 
 %%
-
-#include "repl_scanner.c"
index 586f0d3a5c80d4b65966655c3a2ee0f1cfd5b3c5..23fcb2a11d107f916eaaa904e522b87626dfc094 100644 (file)
@@ -1,4 +1,4 @@
-%{
+%top{
 /*-------------------------------------------------------------------------
  *
  * repl_scanner.l
 #include "utils/builtins.h"
 #include "parser/scansup.h"
 
+/*
+ * NB: include repl_gram.h only AFTER including walsender_private.h, because
+ * walsender_private includes headers that define XLogRecPtr.
+ */
+#include "replication/walsender_private.h"
+#include "repl_gram.h"
+}
+
+%{
 /* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */
 #undef fprintf
 #define fprintf(file, fmt, msg)  fprintf_to_ereport(fmt, msg)
@@ -130,7 +139,7 @@ WAIT                                { return K_WAIT; }
 {space}+               { /* do nothing */ }
 
 {digit}+               {
-                                       yylval.uintval = strtoul(yytext, NULL, 10);
+                                       replication_yylval.uintval = strtoul(yytext, NULL, 10);
                                        return UCONST;
                                }
 
@@ -138,8 +147,8 @@ WAIT                                { return K_WAIT; }
                                        uint32  hi,
                                                        lo;
                                        if (sscanf(yytext, "%X/%X", &hi, &lo) != 2)
-                                               yyerror("invalid streaming start location");
-                                       yylval.recptr = ((uint64) hi) << 32 | lo;
+                                               replication_yyerror("invalid streaming start location");
+                                       replication_yylval.recptr = ((uint64) hi) << 32 | lo;
                                        return RECPTR;
                                }
 
@@ -151,7 +160,7 @@ WAIT                                { return K_WAIT; }
 <xq>{quotestop}        {
                                        yyless(1);
                                        BEGIN(INITIAL);
-                                       yylval.str = litbufdup();
+                                       replication_yylval.str = litbufdup();
                                        return SCONST;
                                }
 
@@ -173,9 +182,9 @@ WAIT                                { return K_WAIT; }
 
                                        yyless(1);
                                        BEGIN(INITIAL);
-                                       yylval.str = litbufdup();
-                                       len = strlen(yylval.str);
-                                       truncate_identifier(yylval.str, len, true);
+                                       replication_yylval.str = litbufdup();
+                                       len = strlen(replication_yylval.str);
+                                       truncate_identifier(replication_yylval.str, len, true);
                                        return IDENT;
                                }
 
@@ -186,7 +195,7 @@ WAIT                                { return K_WAIT; }
 {identifier}   {
                                        int                     len = strlen(yytext);
 
-                                       yylval.str = downcase_truncate_identifier(yytext, len, true);
+                                       replication_yylval.str = downcase_truncate_identifier(yytext, len, true);
                                        return IDENT;
                                }
 
@@ -195,7 +204,7 @@ WAIT                                { return K_WAIT; }
                                        return yytext[0];
                                }
 
-<xq,xd><<EOF>> { yyerror("unterminated quoted string"); }
+<xq,xd><<EOF>> { replication_yyerror("unterminated quoted string"); }
 
 
 <<EOF>>                        {
@@ -231,7 +240,7 @@ addlitchar(unsigned char ychar)
 }
 
 void
-yyerror(const char *message)
+replication_yyerror(const char *message)
 {
        ereport(ERROR,
                        (errcode(ERRCODE_SYNTAX_ERROR),
index d932f2cda32044349f86c1ab76c9c165b7d78482..4fc3647da15eeb2eddcee3510656e8e939255cb2 100644 (file)
@@ -112,5 +112,3 @@ create_syncrep_config(const char *num_sync, List *members, uint8 syncrep_method)
 
        return config;
 }
-
-#include "syncrep_scanner.c"
index 1952c8c6e02e8621a91376945b38acadceb01c8a..bdb1a3391cf0f3b0769722fd71c8dfc4b92c2e96 100644 (file)
@@ -1,4 +1,4 @@
-%{
+%top{
 /*-------------------------------------------------------------------------
  *
  * syncrep_scanner.l
 
 #include "lib/stringinfo.h"
 
+/*
+ * NB: include syncrep_gram.h only AFTER including syncrep.h, because syncrep.h
+ * includes node definitions needed for YYSTYPE.
+ */
+#include "replication/syncrep.h"
+#include "syncrep_gram.h"
+}
+
+%{
 /* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */
 #undef fprintf
 #define fprintf(file, fmt, msg)  fprintf_to_ereport(fmt, msg)
@@ -82,28 +91,28 @@ xdinside            [^"]+
                                appendStringInfoString(&xdbuf, yytext);
                }
 <xd>{xdstop} {
-                               yylval.str = xdbuf.data;
+                               syncrep_yylval.str = xdbuf.data;
                                xdbuf.data = NULL;
                                BEGIN(INITIAL);
                                return NAME;
                }
 <xd><<EOF>> {
-                               yyerror("unterminated quoted identifier");
+                               syncrep_yyerror("unterminated quoted identifier");
                                return JUNK;
                }
 
 {identifier} {
-                               yylval.str = pstrdup(yytext);
+                               syncrep_yylval.str = pstrdup(yytext);
                                return NAME;
                }
 
 {digit}+       {
-                               yylval.str = pstrdup(yytext);
+                               syncrep_yylval.str = pstrdup(yytext);
                                return NUM;
                }
 
 "*"            {
-                               yylval.str = "*";
+                               syncrep_yylval.str = "*";
                                return NAME;
                }
 
index 48cf941a522fe0fdcb199007d3817dc07d5ab1c2..7fab054407ecadbff64bbd1639724357b2dd923d 100644 (file)
@@ -1,2 +1,3 @@
+/jsonpath_gram.h
 /jsonpath_gram.c
 /jsonpath_scan.c
index 7c722ea2ce5280b74f2db9e0719dff0ca5d15e15..0de0bbb1b8ac7ccb60ea1ab39dbadf7004ea7586 100644 (file)
@@ -57,6 +57,7 @@ OBJS = \
        jsonpath.o \
        jsonpath_exec.o \
        jsonpath_gram.o \
+       jsonpath_scan.o \
        like.o \
        like_support.o \
        lockfuncs.o \
@@ -119,11 +120,17 @@ OBJS = \
        xid8funcs.o \
        xml.o
 
+# See notes in src/backend/parser/Makefile about the following two rules
+jsonpath_gram.h: jsonpath_gram.c
+       touch $@
+
+jsonpath_gram.c: BISONFLAGS += -d
+
 jsonpath_scan.c: FLEXFLAGS = -CF -p -p
 jsonpath_scan.c: FLEX_NO_BACKUP=yes
 
-# jsonpath_scan is compiled as part of jsonpath_gram
-jsonpath_gram.o: jsonpath_scan.c
+# Force these dependencies to be known even without dependency info built:
+jsonpath_gram.o jsonpath_scan.o: jsonpath_gram.h
 
 # jsonpath_gram.c and jsonpath_scan.c are in the distribution tarball,
 # so they are not cleaned here.
index ce5d5af8916af674c1e7f87921187f788b5c72c6..35a79ca965e7e91535cb184f2a47314148efc653 100644 (file)
 
 #include "catalog/pg_collation.h"
 #include "fmgr.h"
+#include "jsonpath_internal.h"
 #include "miscadmin.h"
 #include "nodes/pg_list.h"
 #include "regex/regex.h"
 #include "utils/builtins.h"
-#include "utils/jsonpath.h"
-
-/* struct JsonPathString is shared between scan and gram */
-typedef struct JsonPathString
-{
-       char       *val;
-       int                     len;
-       int                     total;
-}                      JsonPathString;
-
-union YYSTYPE;
-
-/* flex 2.5.4 doesn't bother with a decl for this */
-int    jsonpath_yylex(union YYSTYPE *yylval_param);
-int    jsonpath_yyparse(JsonPathParseResult **result);
-void jsonpath_yyerror(JsonPathParseResult **result, const char *message);
 
 static JsonPathParseItem *makeItemType(JsonPathItemType type);
 static JsonPathParseItem *makeItemString(JsonPathString *s);
@@ -593,13 +578,3 @@ jspConvertRegexFlags(uint32 xflags)
 
        return cflags;
 }
-
-/*
- * jsonpath_scan.l is compiled as part of jsonpath_gram.y.  Currently, this is
- * unavoidable because jsonpath_gram does not create a .h file to export its
- * token symbols.  If these files ever grow large enough to be worth compiling
- * separately, that could be fixed; but for now it seems like useless
- * complication.
- */
-
-#include "jsonpath_scan.c"
diff --git a/src/backend/utils/adt/jsonpath_internal.h b/src/backend/utils/adt/jsonpath_internal.h
new file mode 100644 (file)
index 0000000..edfc619
--- /dev/null
@@ -0,0 +1,32 @@
+/*-------------------------------------------------------------------------
+ *
+ * jsonpath_internal.h
+ *     Private definitions for jsonpath scanner & parser
+ *
+ * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/backend/utils/adt/jsonpath_internal.h
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef JSONPATH_INTERNAL_H
+#define JSONPATH_INTERNAL_H
+
+/* struct JsonPathString is shared between scan and gram */
+typedef struct JsonPathString
+{
+       char       *val;
+       int                     len;
+       int                     total;
+}                      JsonPathString;
+
+#include "utils/jsonpath.h"
+#include "jsonpath_gram.h"
+
+extern int     jsonpath_yylex(YYSTYPE *yylval_param);
+extern int     jsonpath_yyparse(JsonPathParseResult **result);
+extern void jsonpath_yyerror(JsonPathParseResult **result, const char *message);
+
+#endif                                                 /* JSONPATH_INTERNAL_H */
index 4351f6ec9814a6b0e0410732cbc2bbb879366479..ea824bae73e61b6a09f0832d5e47a1e4c4b93cae 100644 (file)
@@ -1,4 +1,4 @@
-%{
+%top{
 /*-------------------------------------------------------------------------
  *
  * jsonpath_scan.l
 
 #include "postgres.h"
 
+/*
+ * NB: include jsonpath_gram.h only AFTER including jsonpath_internal.h,
+ * because jsonpath_internal.h contains the declaration for JsonPathString.
+ */
+#include "jsonpath_internal.h"
+#include "jsonpath_gram.h"
+
 #include "mb/pg_wchar.h"
 #include "nodes/pg_list.h"
+}
 
+%{
 static JsonPathString scanstring;
 
 /* Handles to the buffer that the lexer uses internally */
@@ -142,9 +151,9 @@ hex_fail    \\x{hex_dig}{0,1}
 
 <xnq,xq,xvq>{hex_char}         { parseHexChar(yytext); }
 
-<xnq,xq,xvq>{unicode}*{unicodefail}    { yyerror(NULL, "invalid unicode sequence"); }
+<xnq,xq,xvq>{unicode}*{unicodefail}    { jsonpath_yyerror(NULL, "invalid unicode sequence"); }
 
-<xnq,xq,xvq>{hex_fail}         { yyerror(NULL, "invalid hex character sequence"); }
+<xnq,xq,xvq>{hex_fail}         { jsonpath_yyerror(NULL, "invalid hex character sequence"); }
 
 <xnq,xq,xvq>{unicode}+\\       {
                                                                /* throw back the \\, and treat as unicode */
@@ -154,9 +163,9 @@ hex_fail    \\x{hex_dig}{0,1}
 
 <xnq,xq,xvq>\\.                                { addchar(false, yytext[1]); }
 
-<xnq,xq,xvq>\\                         { yyerror(NULL, "unexpected end after backslash"); }
+<xnq,xq,xvq>\\                         { jsonpath_yyerror(NULL, "unexpected end after backslash"); }
 
-<xq,xvq><<EOF>>                                { yyerror(NULL, "unexpected end of quoted string"); }
+<xq,xvq><<EOF>>                                { jsonpath_yyerror(NULL, "unexpected end of quoted string"); }
 
 <xq>\"                                                 {
                                                                        yylval->str = scanstring;
@@ -178,7 +187,7 @@ hex_fail    \\x{hex_dig}{0,1}
 
 <xc>\*                                                 { }
 
-<xc><<EOF>>                                            { yyerror(NULL, "unexpected end of comment"); }
+<xc><<EOF>>                                            { jsonpath_yyerror(NULL, "unexpected end of comment"); }
 
 \&\&                                                   { return AND_P; }
 
@@ -244,10 +253,10 @@ hex_fail  \\x{hex_dig}{0,1}
                                                                        return INT_P;
                                                                }
 
-{realfail}                                             { yyerror(NULL, "invalid numeric literal"); }
-{integer_junk}                                 { yyerror(NULL, "trailing junk after numeric literal"); }
-{decimal_junk}                                 { yyerror(NULL, "trailing junk after numeric literal"); }
-{real_junk}                                            { yyerror(NULL, "trailing junk after numeric literal"); }
+{realfail}                                             { jsonpath_yyerror(NULL, "invalid numeric literal"); }
+{integer_junk}                                 { jsonpath_yyerror(NULL, "trailing junk after numeric literal"); }
+{decimal_junk}                                 { jsonpath_yyerror(NULL, "trailing junk after numeric literal"); }
+{real_junk}                                            { jsonpath_yyerror(NULL, "trailing junk after numeric literal"); }
 
 \"                                                             {
                                                                        addchar(true, '\0');
index 1d5327cf644a63fbc2c4d957884d4b354402335c..cf7ce9bc83788fabd546df4d8b178231c53c2d70 100644 (file)
@@ -16,6 +16,7 @@ override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS)
 
 OBJS = \
        guc.o \
+       guc-file.o \
        help_config.o \
        pg_config.o \
        pg_controldata.o \
@@ -37,10 +38,6 @@ endif
 
 include $(top_srcdir)/src/backend/common.mk
 
-# guc-file is compiled as part of guc
-guc.o: guc-file.c
-
 # Note: guc-file.c is not deleted by 'make clean',
 # since we want to ship it in distribution tarballs.
 clean:
-       @rm -f lex.yy.c
index 8b5b299efd8c13f3b41fd848cb89a993bc39eccd..4f43430db4c36bde3df57993c5a648110795eab0 100644 (file)
@@ -1,4 +1,4 @@
-/* -*-pgsql-c-*- */
+%top{
 /*
  * Scanner for the configuration file
  *
@@ -7,8 +7,6 @@
  * src/backend/utils/misc/guc-file.l
  */
 
-%{
-
 #include "postgres.h"
 
 #include <ctype.h>
 #include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "storage/fd.h"
+#include <sys/stat.h>
+#include "utils/memutils.h"
+}
 
 
+%{
 /*
  * flex emits a yy_fatal_error() function that it calls in response to
  * critical errors like malloc failure, file I/O errors, and detection of
index 0e6c13fa2a74123b5146b3d02974d92d6974795c..c336698ad583ff26a081e7919f9e187ccd77f0fd 100644 (file)
@@ -13333,5 +13333,3 @@ check_default_with_oids(bool *newval, void **extra, GucSource source)
 
        return true;
 }
-
-#include "guc-file.c"
index 983a3cd7a6d81d6a441c36507998983ca76b037d..07492a993c991e6e910d069cd0631b3332849dd9 100644 (file)
@@ -1,3 +1,4 @@
+/exprparse.h
 /exprparse.c
 /exprscan.c
 /pgbench
index f402fe7b9127b201f14d5bf5d120ca70d53f2324..6647c9fe97d2764d90a6dc7374a711132eda480f 100644 (file)
@@ -10,6 +10,7 @@ include $(top_builddir)/src/Makefile.global
 OBJS = \
        $(WIN32RES) \
        exprparse.o \
+       exprscan.o \
        pgbench.o
 
 override CPPFLAGS := -I. -I$(srcdir) -I$(libpq_srcdir) $(CPPFLAGS)
@@ -26,8 +27,14 @@ all: pgbench
 pgbench: $(OBJS) | submake-libpq submake-libpgport submake-libpgfeutils
        $(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
 
-# exprscan is compiled as part of exprparse
-exprparse.o: exprscan.c
+# See notes in src/backend/parser/Makefile about the following two rules
+exprparse.h: exprparse.c
+       touch $@
+
+exprparse.c: BISONFLAGS += -d
+
+# Force these dependencies to be known even without dependency info built:
+exprparse.o exprscan.o: exprparse.h
 
 distprep: exprparse.c exprscan.c
 
@@ -45,7 +52,7 @@ clean distclean:
        rm -rf tmp_check
 
 maintainer-clean: distclean
-       rm -f exprparse.c exprscan.c
+       rm -f exprparse.h exprparse.c exprscan.c
 
 check:
        $(prove_check)
index b5592d4b97d03824e666d7224597740d9b761c67..ade2ecdaab89c3728015ba26420744f12bbe8e83 100644 (file)
@@ -526,18 +526,3 @@ make_case(yyscan_t yyscanner, PgBenchExprList *when_then_list, PgBenchExpr *else
                                         find_func(yyscanner, "!case_end"),
                                         make_elist(else_part, when_then_list));
 }
-
-/*
- * exprscan.l is compiled as part of exprparse.y.  Currently, this is
- * unavoidable because exprparse does not create a .h file to export
- * its token symbols.  If these files ever grow large enough to be
- * worth compiling separately, that could be fixed; but for now it
- * seems like useless complication.
- */
-
-/* First, get rid of "#define yyscan_t" from pgbench.h */
-#undef yyscan_t
-/* ... and the yylval macro, which flex will have its own definition for */
-#undef yylval
-
-#include "exprscan.c"
index 4f63818606e4c08d6cae5d02c599d12712cc8d99..fe8e32838a7ffc533c5238805a986658b9e3b217 100644 (file)
@@ -1,4 +1,4 @@
-%{
+%top{
 /*-------------------------------------------------------------------------
  *
  * exprscan.l
  *
  *-------------------------------------------------------------------------
  */
+#include "postgres_fe.h"
 
+/*
+ * NB: include exprparse.h only AFTER including pgbench.h, because pgbench.h
+ * contains definitions needed for YYSTYPE. Likewise, pgbench.h must come after
+ * psqlscan_int.h for yyscan_t.
+ */
 #include "fe_utils/psqlscan_int.h"
+#include "pgbench.h"
+#include "exprparse.h"
+}
 
+%{
 /* context information for reporting errors in expressions */
 static const char *expr_source = NULL;
 static int     expr_lineno = 0;
index 870dac4d281bf21b3999404a60ba1f5e11abd156..2c13b4bf985aa66425383a04642082874b266147 100644 (file)
@@ -3,6 +3,7 @@
 /pg_isolation_regress
 
 # Local generated source files
+/specparse.h
 /specparse.c
 /specscanner.c
 
index 0d452c89d40cff34fb3b12ed890d3f9ea5f1a218..b8738b7c1be902f0c1d148e9f250f4a465e482f5 100644 (file)
@@ -15,7 +15,8 @@ override CPPFLAGS := -I. -I$(srcdir) -I$(libpq_srcdir) \
 OBJS = \
        $(WIN32RES) \
        isolationtester.o \
-       specparse.o
+       specparse.o \
+       specscanner.o
 
 all: isolationtester$(X) pg_isolation_regress$(X)
 
@@ -44,8 +45,14 @@ isolationtester$(X): $(OBJS) | submake-libpq submake-libpgport
 
 distprep: specparse.c specscanner.c
 
-# specscanner is compiled as part of specparse
-specparse.o: specscanner.c
+# See notes in src/backend/parser/Makefile about the following two rules
+specparse.h: specparse.c
+       touch $@
+
+specparse.c: BISONFLAGS += -d
+
+# Force these dependencies to be known even without dependency info built:
+specparse.o specscanner.o: specparse.h
 
 # specparse.c and specscanner.c are in the distribution tarball,
 # so do not clean them here
@@ -55,7 +62,7 @@ clean distclean:
        rm -rf $(pg_regress_clean_files)
 
 maintainer-clean: distclean
-       rm -f specparse.c specscanner.c
+       rm -f specparse.h specparse.c specscanner.c
 
 installcheck: all
        $(pg_isolation_regress_installcheck) --schedule=$(srcdir)/isolation_schedule
index eb368184b8b5aeaec91401f30cb4a6a58bc574a3..657285cc23460975659be8e6c92a7ec5764f2eb8 100644 (file)
@@ -276,5 +276,3 @@ blocker:
                ;
 
 %%
-
-#include "specscanner.c"
index aa6e89268ef069377411335e0d60dabf4c4c5f8a..b04696f52d7fa6b691d64b00b8dcd96c5d28d612 100644 (file)
@@ -1,4 +1,4 @@
-%{
+%top{
 /*-------------------------------------------------------------------------
  *
  * specscanner.l
@@ -9,7 +9,17 @@
  *
  *-------------------------------------------------------------------------
  */
+#include "postgres_fe.h"
 
+/*
+ * NB: include specparse.h only AFTER including isolationtester.h, because
+ * isolationtester.h includes node definitions needed for YYSTYPE.
+ */
+#include "isolationtester.h"
+#include "specparse.h"
+}
+
+%{
 static int     yyline = 1;                     /* line number for error reporting */
 
 #define LITBUF_INIT    1024            /* initial size of litbuf */
@@ -75,7 +85,7 @@ teardown              { return TEARDOWN; }
 
  /* Plain identifiers */
 {identifier}   {
-                                       yylval.str = pg_strdup(yytext);
+                                       spec_yylval.str = pg_strdup(yytext);
                                        return(identifier);
                                }
 
@@ -87,13 +97,13 @@ teardown            { return TEARDOWN; }
 <qident>\"\"   { addlitchar(yytext[0]); }
 <qident>\"             {
                                        litbuf[litbufpos] = '\0';
-                                       yylval.str = pg_strdup(litbuf);
+                                       spec_yylval.str = pg_strdup(litbuf);
                                        BEGIN(INITIAL);
                                        return(identifier);
                                }
 <qident>.              { addlitchar(yytext[0]); }
-<qident>\n             { yyerror("unexpected newline in quoted identifier"); }
-<qident><<EOF>>        { yyerror("unterminated quoted identifier"); }
+<qident>\n             { spec_yyerror("unexpected newline in quoted identifier"); }
+<qident><<EOF>>        { spec_yyerror("unterminated quoted identifier"); }
 
  /* SQL blocks: { UPDATE ... } */
  /* We trim leading/trailing whitespace, otherwise they're unprocessed */
@@ -104,7 +114,7 @@ teardown            { return TEARDOWN; }
                                }
 <sql>{space}*"}" {
                                        litbuf[litbufpos] = '\0';
-                                       yylval.str = pg_strdup(litbuf);
+                                       spec_yylval.str = pg_strdup(litbuf);
                                        BEGIN(INITIAL);
                                        return(sqlblock);
                                }
@@ -116,12 +126,12 @@ teardown          { return TEARDOWN; }
                                        addlitchar(yytext[0]);
                                }
 <sql><<EOF>>   {
-                                       yyerror("unterminated sql block");
+                                       spec_yyerror("unterminated sql block");
                                }
 
  /* Numbers and punctuation */
 {digit}+               {
-                                       yylval.integer = atoi(yytext);
+                                       spec_yylval.integer = atoi(yytext);
                                        return INTEGER;
                                }
 
@@ -150,7 +160,7 @@ addlitchar(char c)
 }
 
 void
-yyerror(const char *message)
+spec_yyerror(const char *message)
 {
        fprintf(stderr, "%s at line %d\n", message, yyline);
        exit(1);
index b8419e46a492c98bb8db00ad177d0c9ae083ffc0..2a88bd9f00e77ed13ea2e0f0b98a24076bf8c094 100755 (executable)
@@ -117,10 +117,18 @@ do
        # We can't make these Bison output files compilable standalone
        # without using "%code require", which old Bison versions lack.
        # parser/gram.h will be included by parser/gramparse.h anyway.
+       test "$f" = contrib/cube/cubeparse.h && continue
+       test "$f" = contrib/seg/segparse.h && continue
+       test "$f" = src/backend/bootstrap/bootparse.h && continue
        test "$f" = src/include/parser/gram.h && continue
        test "$f" = src/backend/parser/gram.h && continue
+       test "$f" = src/backend/replication/repl_gram.h && continue
+       test "$f" = src/backend/replication/syncrep_gram.h && continue
+       test "$f" = src/backend/utils/adt/jsonpath_gram.h && continue
+       test "$f" = src/bin/pgbench/exprparse.h && continue
        test "$f" = src/pl/plpgsql/src/pl_gram.h && continue
        test "$f" = src/interfaces/ecpg/preproc/preproc.h && continue
+       test "$f" = src/test/isolation/specparse.h && continue
 
        # This produces a "no previous prototype" warning.
        test "$f" = src/include/storage/checksum_impl.h && continue