Hi,
Thank you for all your explanations, now everything is much clearer. But, please, let me ask you another last question regarding:
The problem for me is that I’ll have to make some source-to-source translations: sometimes I’ll have to modify the .cpp file and sometimes the .h (or even both of them) For instance, if i want to know if a certain method is declared as “virtual”, I would need to examinate the .h file. Thus, I cannot exclude all .h files. So, how can I manage this?
Well, you exclude just the system header files in the match callback, as I’ve showed before, using SourceManager :: isInSystemHeader and isInExternCSystemHeader.
Ok, I see that i can exclude all the system headers, but imagine the next cpp:
#include “A.h”
#include “B.h”
… …
}
int A::m() {
B b; //B.h header has been included because it’s needed in a member function of A
… …
}
… …
And I only want to retrieve nodes inside class A (in A.h and A.cpp), but not inside B.h because I’m not interested in this class. How can I avoid this?
In addition, in the matcher we’ve working on, we looked for default constructors declarations defined inline. But several options more were possible:
- I have both declaration and definition inline in A.h
- I have both declaration and definition inline in A.cpp
- I have declaration in A.h and definition in A.cpp (the example above)
- I have declaration and definition (but not inline) in A.cpp
We have considered 1 and 2, but not 3 nor 4. Imagine that we have the case 3 and I want to delete the constructor both in A.h(declaration) and A.cpp(definition). Do I have to prepare two different matchers to look for them? Or is there a way that, for example, I find the definition and then I can refer its declaration? Of course, I need to make sure that both, definition and declaration are deleted.
I hope you know what I mean.
Thanks for everything Gábor,
Pedro.
El dia 22 abr 2013 21:52, Gábor Kozár kozargabor@gmail.com escribió: