> What problem are you trying to solve here? to whit not everything that can be parsed is documented - usually intentionally.
I am tyring to see whether we could use the documentation as a kind of formal specification of the language but I understand that the devil is
in the details and that even formal specifications can lead to incompatible implementations,
I would have found it nice if the clean documentation of the project could be used as a meta-grammar sufficient to maybe generate the grammar but I will have to dig further into the Bison grammar files.
The project I mentioned that isolates the parser from PostgreSQL binary as a re-usable library is probably the closest you can get currently to a parser matching the real engine.
Otherwise, yes, parsing the synopsis could maybe lead to a sanity check on the fact that the documentation is in line with the grammar. This could lead to warnings or help uncover unexpected corner cases not mentioned in the documentation.
Thanks for your answers
Jerome