From: Tom Lane <tgl@sss.pgh.pa.us>
To: Дилян Палаузов <dpa-postgres@aegee.org>
Cc: pgsql-bugs@postgresql.org
Subject: Re: base_yylex undefined in src/interface/ecpg/preproc/parser.c
Date: Sun, 11 Dec 2016 13:32:50 -0500
Message-ID: <12637.1481481170@sss.pgh.pa.us> (raw)
In-Reply-To: <d845c1af-e18d-6651-178f-9f08cdf37e10@aegee.org>
References: <d845c1af-e18d-6651-178f-9f08cdf37e10@aegee.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
=?UTF-8?B?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?= <dpa-postgres@aegee.org> writes:
> with the newest flex (v2.6.2-19-g6bea32e, which is newer than 2.6.3) I
> need this patch to compile postgres:
Ugh.
> With previous versions of flex the compilation has worked. But I do not
> find in the code where is supposed yylex to be renamed to base_yylex
> when parser.c is proccessed. pgc.l also does not use %option
> prefix=base_yy, which would be the right way to rename yylex (apart from
> #define YY_DECL).
> What is the purpose to rename yylex to base_yylex?
It's mostly for consistency with the backend, where we have multiple bison
parsers (and multiple flex lexers) so there's a policy of renaming all of
them away from the default name. Since ecpg is a standalone program,
we could in principle not bother to rename its parser; but I'd rather
keep it in as close sync with the corresponding backend code as possible.
The reason for the current hacky approach is explained in pgc.l:
/*
* Change symbol names as expected by preproc.y. 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
Looks like it's time to pay down that technical debt.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, dpa-postgres@aegee.org
Subject: Re: base_yylex undefined in src/interface/ecpg/preproc/parser.c
In-Reply-To: <12637.1481481170@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox