Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a compiler as service for c++?

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.

like image 402
Tenshiko Avatar asked Apr 17 '12 22:04

Tenshiko


1 Answers

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.

like image 73
David Brown Avatar answered Oct 05 '22 21:10

David Brown