I'm looking to get the line number for the last line of the constructor with clang-query, does anyone know how to get there?
i have a lot of source files to go through, and needing to update the constructors. i spent time trying to parse the source file with regex, and it works okay with a lot of corner cases. so this was the next item on the list.
I tried search around the the web and stack overflow, but i couldnt find too much and at a bit of a lost for how the language parser works. in addition, i played with this tool, http://ce.steveire.com/, with m cxxConstructorDecl()
being my input to the clang-query, but it gives me matches for 4 lines that contains "MyClass" and it only gives me the line of the first line of the constructor. any help is appreciated!
class MyClass { // The class
public: // Access specifier
int myNum; // Attribute (int variable)
MyClass (int in_val);
};
// Constructor definition outside the class
MyClass::MyClass(int in_val) {
myNum = in_val;
// <<< this line >>>
}