Re: pure parsers and reentrant scanners

Peter Eisentraut <peter@eisentraut.org>

From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-01-24T06:46:48Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Return yyparse() result not via global variable

  2. Remove flex version checks

  3. Drop warning-free support for Flex 2.5.35

  4. plpgsql: pure parser and reentrant scanner

  5. flex code modernization: Replace YY_EXTRA_TYPE define with flex option

  6. guc: reentrant scanner

  7. jsonpath scanner: reentrant scanner

  8. syncrep parser: pure parser and reentrant scanner

  9. replication parser: pure parser and reentrant scanner

  10. bootstrap: pure parser and reentrant scanner

  11. Small whitespace improvement

  12. Prevent redeclaration of typedef yyscan_t

  13. seg: pure parser and reentrant scanner

  14. cube: pure parser and reentrant scanner

On 17.01.25 16:40, Peter Eisentraut wrote:
> Here are some more patches.  This should cover the last sub-topic of 
> this topic: not passing the yyparse() result via global variables.  This 
> uses techniques that are already in use in some parsers in the tree, for 
> example cube and jsonpath.  The syncrep parser was a bit trickier, 
> because there we need to pass the syncrep_parse_error variable all the 
> way down to the scanner (not just the parser), but overall it's all 
> still pretty compact and standard.

This has been committed.

I think this concludes this topic.

For those who haven't seen it, I wrote a blog post about this: 
https://peter.eisentraut.org/blog/2025/01/21/implementing-thread-safe-scanners-and-parsers-in-postgresql