I am looking for a C/C++ library. It should be able to parse C++ source code and generate abstract syntax tree. I would also like to explore/edit the AST from my program, for example to add a function call. This means, the syntax tree should not be in some text format, but as a collection of C++ objects, based on the object model of the library itself.
It should also be able to generate C++ code from an AST.
It is clear that any compiler does this and probably has some API. I have heard that GCC exposes some functionality, but it is quite overwhelming under the hood.
I am aware of Elsa, but the project seems to be inactive for quite some time.
I was wondering if there are other options. Anything that is cross-platform is a plus.