@PeterJones and others
Constructors and destructors do not have return type. Researching Regex sequences of the Function List parser with RegEx101 tool shows that the parser expects functions to have return type. Functions without return type do not appear in the Function List. I changed Regex making return type optional. Change makes constructors without initializer to appear in the Function List but destructors are still missing. The reason is the name of the destructor which starts with tilde ‘~’ which is not the word character. Regex expects function names to be words. Changing the Regex seguence “\w+” to “~?\w+” enables function names to start with tilde. Now destructors are shown also. Constructors with initializer are still missing though. They contain additional code inside initializer between ‘:’ and ‘{’ and the Regex inside mainExpr marks “functions” found inside initalizer too. That confuses the parser and Function List is not built. Regex should skip the code inside the initializer, but I don’t know how to achieve this without regular expression replacement or modification which is not supported inside the parser.
I found that changes in overrideMap.xml are ignored, only changes in cpp.xml are being accepted.
Example:
// ExampleClass.h
class ExampleClass
{
private:
int i;
int j;
public:
ExampleClass(int x, int y=0); // ctor1
ExampleClass(); // ctor2
~ExampleClass(); // dtor
void Method1();
int Method2() { return i+j; }
};
// ExampleClass.cpp
#include "ExampleClass.h"
// constructor with initializer (ctor1)
ExampleClass::ExampleClass(int x, int y) : i(x), j(y)
{
allocate();
}
// constructor without initializer (ctor2)
ExampleClass::ExampleClass()
{
i = 0;
j = 0;
allocate();
}
// destructor (dtor)
ExampleClass::~ExampleClass()
{
deallocate();
}
// function not belonging to the class
void HelperFunction()
{
return;
}
// class method
void ExampleClass::Method1()
{
return;
}
Function list with modified cpp.xml:
ba3429fb-67ec-43cf-80e8-e5701df3f950-image.png
I put modified cpp.xml on temporary test location for those who want to test it.
I tested modified cpp.xml on my sources and it works for me.