I've been able to properly use the abstract syntax tree APIs in CDT for parsing pre-existing C code in my program. However, I can't seem to find any examples on doing the reverse, (creating an AST programmatically and turning it into source code), so I am wondering if this is even possible. I would like to use an AST to generate code as it seems like it would make the process extremely easy.
If it is indeed possible, then what would be a starting point for using the API to generate an AST, and then source code from it? (Preferably no internal/deprecated methods)
Just in case anyone stumbles on this topic, I didn't get an answer here but got one on StackOverflow, Which I can't link to because I don't have enough messages (google "Using CDT's Abstract Syntax Tree API to generate/write C code?")
It's not a 'solve everything' answer but it seems a good starting point.