That's super interesting. Do you use DCGs to read your data or do you call external libraries? How do you generate C code? Do you use a template system?
For such tasks I prefer quasi-quotation [0] or a simple format with goal expansion [1]. As for readers I rarely need ones, because XML, YAML, JSON are already included.
In order to do code analysis I first pulled pieces using Regex (mostly headers) and only then parsed them over with DCG. Which is also neat when creating own DSLs - one can ask people on meeting to decorate lightly notes and get - semantic linking almost for free.
[0]: https://www.swi-prolog.org/pldoc/man?section=quasiquotations [1]: https://www.swi-prolog.org/pldoc/man?section=format-predicat...