Make pgbench's expression lexer reentrant.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 19 Mar 2016 20:35:41 +0000 (16:35 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 19 Mar 2016 20:35:41 +0000 (16:35 -0400)
commit429ee5a822db0e8faf669d77c810f1eeaaff1ab4
tree60b96ede0aed5ad8511e197741060a185894f001
parent1038bc91ca98865bd60bf63db46fc331f3099998
Make pgbench's expression lexer reentrant.

This is a necessary preliminary step for making it play with psqlscan.l
given the way I set up the lexer input-buffer sharing mechanism in commit
0ea9efbe9ec1bf07.

I've not tried to make it *actually* reentrant; there's still some static
variables laying about.  But flex thinks it's reentrant, and that's what
counts.

In support of that, fix exprparse.y to pass through the yyscan_t from the
caller.  Also do some minor code beautification, like not casting away
const.
src/bin/pgbench/exprparse.y
src/bin/pgbench/exprscan.l
src/bin/pgbench/pgbench.c
src/bin/pgbench/pgbench.h