pgsql: Use "%option prefix" to set API names in ecpg's lexer.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Use "%option prefix" to set API names in ecpg's lexer.
Date: 2016-12-11 19:54:40
Message-ID: E1cGACm-0000gT-4T@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Use "%option prefix" to set API names in ecpg's lexer.

Clean up some technical debt left behind by commit 72b1e3a21: instead of
quickly hacking the name of base_yylex() with a #define, set it properly
with "%option prefix". This causes the names of pgc.l's other exported
symbols to change as well, so run around and modify the outside references
to them as needed. Similarly, make pgc.l's external references to
base_yylval use that variable's true name instead of a macro.

The reason for doing this now is that the quick-hack solution will fail
with future versions of flex, as reported by Дилян Палаузов.
Hence, back-patch into 9.6 where the previous commit appeared, since
it's likely people will build 9.6 with newer flex versions during
its lifetime.

Discussion: https://postgr.es/m/d845c1af-e18d-6651-178f-9f08cdf37e10@aegee.org

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/92fb649837e36944bd0e9eed6c90b4b01b7deb18

Modified Files
--------------
src/interfaces/ecpg/preproc/descriptor.c | 28 +++++++-------
src/interfaces/ecpg/preproc/ecpg.addons | 30 +++++++--------
src/interfaces/ecpg/preproc/ecpg.c | 40 +++++++++----------
src/interfaces/ecpg/preproc/ecpg.header | 12 +++---
src/interfaces/ecpg/preproc/ecpg.trailer | 18 ++++-----
src/interfaces/ecpg/preproc/extern.h | 10 ++---
src/interfaces/ecpg/preproc/output.c | 66 ++++++++++++++++----------------
src/interfaces/ecpg/preproc/parser.c | 10 ++---
src/interfaces/ecpg/preproc/pgc.l | 66 ++++++++++++++------------------
src/interfaces/ecpg/preproc/variable.c | 2 +-
10 files changed, 138 insertions(+), 144 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-12-11 23:04:49 pgsql: Use "%option prefix" to set API names in ecpg's lexer.
Previous Message Tom Lane 2016-12-11 18:10:14 pgsql: Prevent crash when ts_rewrite() replaces a non-top-level subtree