Is this a proposal to have a better formatted (JSON etc) debug_print_parse results?
I've run into the need for this as well for monitoring purposes, my solution was to compile the needed object files into a library (see [0]).
It'd be interesting to explore if there is some way to make this less hack-ish, and enable tools to parse queries in a better way. Essentially what is needed is some way to reliably translate SQL into an AST-like output, from an outside tool, whilst reusing the current PostgreSQL parser.
I believe the recent work on deparsing DDL statements relates to some of that (i.e. might be re-usable for this purpose, through an extension), if I'm understanding correctly.