aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/preproc/pgc.l
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/ecpg/preproc/pgc.l')
-rw-r--r--src/interfaces/ecpg/preproc/pgc.l14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l
index 397f14ef26f..ec71bbd2afb 100644
--- a/src/interfaces/ecpg/preproc/pgc.l
+++ b/src/interfaces/ecpg/preproc/pgc.l
@@ -1,4 +1,4 @@
-%{
+%top{
/*-------------------------------------------------------------------------
*
* pgc.l
@@ -23,7 +23,19 @@
#include <limits.h>
#include "extern.h"
+#include "preproc.h"
+
+/*
+ * Change symbol names as expected by preproc.l. It'd be better to do this
+ * with %option prefix="base_yy", but that affects some other names that
+ * various files expect *not* to be prefixed with "base_". Cleaning it up
+ * is not worth the trouble right now.
+ */
+#define yylex base_yylex
+#define yylval base_yylval
+}
+%{
extern YYSTYPE yylval;
static int xcdepth = 0; /* depth of nesting in slash-star comments */