Thanks Dmitry and Piotr for comments.
You are write, compiler is not enough in this case.
On Fri, Mar 6, 2015 at 1:04 AM, Piotr Caban piotr.caban@gmail.com wrote:
The problem is that person that implements it in wine can't see native implementation. And parts of it are in the headers. In this case the names mangling gives us function prototype. The problem are class size, virtual functions table, public class members.
Someone else can look on headers and document it for person that writes the implementation.
I have feeling that using libclang to write a customer parsing tool can solve the problem in machine way rather than in human way.
I wrote a proof of concept using libclang pythong binding, see get_class.py.
Example:
$ python get_class.py test.cpp Room Translation unit: test.cpp class Room { public: void add_person(Person) { } Person get_persons() { } int index; }
find_classdecl firstly search for the class match the name we input, then strips all methods and fields except public method and public field, then strips the implementation details of the method, prints only stub implementation of public methods, also prints the declaration of public fields.