Make pgbench's expression lexer reentrant.
Tom Lane <tgl@sss.pgh.pa.us>
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.
Files
| Path | Change | +/− |
|---|---|---|
| src/bin/pgbench/exprparse.y | modified | +37 −20 |
| src/bin/pgbench/exprscan.l | modified | +52 −31 |
| src/bin/pgbench/pgbench.c | modified | +10 −5 |
| src/bin/pgbench/pgbench.h | modified | +18 −8 |