pgsql: Use %option bison-bridge in psql/pgbench lexers. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Use %option bison-bridge in psql/pgbench lexers.
Date
Msg-id E1ahp7q-00020q-Ii@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Use %option bison-bridge in psql/pgbench lexers.

The point of this change is to use %pure-parser in pgbench's exprparse.y.
The immediate reason is that it turns out very ancient versions of bison
have a bug with the combination of a reentrant lexer and non-reentrant
parser.  We could consider dropping support for such ancient bisons; but
considering that we might well need exprparse.y to be reentrant some day,
it seems better to make it so right now than to move the portability
goalposts.  (AFAICT there's no particular performance consequence to this
change, either, so there's no good reason not to do it.)

Now, %pure-parser assumes that the called lexer is built with %option
bison-bridge.  Because we're assuming bitwise compatibility of yyscan_t
(yyguts_t) data structures among all the psql/pgbench lexers, that
requirement propagates back to psql's lexers as well.  But it's just a
few lines of change on that side too; and if psqlscan.l is to set the
baseline for a possibly-large family of lexers, it should err on the
side of including not omitting useful features.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/b6afae71aaf6d2df76d0a0a77c8b630220a01ec1

Modified Files
--------------
src/bin/pgbench/exprparse.y  |  3 +++
src/bin/pgbench/exprscan.l   | 13 ++++++++-----
src/bin/pgbench/pgbench.h    | 12 +++++++++---
src/bin/psql/psqlscan.l      |  9 ++++++++-
src/bin/psql/psqlscanslash.l | 14 +++++++++++---
5 files changed, 39 insertions(+), 12 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Best-guess attempt at fixing MSVC build for 68ab8e8ba4a471d9.
Next
From: David Rowley
Date:
Subject: Re: pgsql: Best-guess attempt at fixing MSVC build for 68ab8e8ba4a471d9.