Alex Rivera | Logout

Is there a compiler as service for c++?

Asked 2012-04-17T22:11:27.010
11

In short: I am looking for something like Roslyn but for C++.

In detail:

I am dealing with a c# project where I have to work with c++ files. I have a bunch of .h (about 250 files) and .cpp and I would like to map the classes and functions and what not, that are defined in these files.

It is for a modeling task. I do not wish to use the actual c++ library.

I did not write the c++ code, so I cannot be sure if there are nested classes anywhere. So this is not a "simple" regex task.

The project is in c#, and the library I'd like to use is in c++. I cannot change that.

Edit
Report

1 Answer

12

I believe libclang has the functionality you want. It's basically a C interface for accessing much of the information stored in clang's C/C++ AST. The documentation is a bit terse so here is a good video on what it can do with some examples.

answered 2012-04-17T23:10:47.940

Your Answer