pganalyze / libpg_query

C library for accessing the PostgreSQL parser outside of the server environment
BSD 3-Clause "New" or "Revised" License
1.21k stars 182 forks source link

how to generate src_backend_*.c files from flex&bison source file #266

Closed cjbd closed 1 month ago

cjbd commented 1 month ago

Hello, is there a guide or script to generate all those src_backend_*.c files from flex&bison source code like scan.l, grammar.y? thanks!

lfittl commented 1 month ago

@cjbd Those files are automatically extracted from the Postgres source, via libclang. See scripts/extract_source.rb and extract_source Makefile target.

Out of curiosity, what's the use case where you're trying to generate these files?

cjbd commented 1 month ago

@lfittl thanks a lot! i just started learning sql parsing, i thought all parser code was supposed to be generated by flex&bison