I am coding a tool to parse C++ code. I don't want to end up coding half of a compiler. Even though I am aware of Clang, that is too much for my purposes.
I was hand-parsing, but have come up against one too many coding styles.
I seek a tool which will parse C++ code, with only one important factor :
It must be able to put the entire function declaration on a single line.
So, things like
unsigned
int
myclass::
myfunc
(int x;
int y)
{
}
and all of its many variations, should become
unsigned int myclass::myfunc(int x; int y)
{
}
That’s all that I need for this particular project - the ability to find each function in a file and get it's return type.
Nice if it's Linux, but I can live with Windows.
GUI would be nice, with preview being a bonus.
Batch mode would be nice, including the ability to recursively process a given directory.
But none of those nice are mandatory, only the single line for the function declaration requirement is
.
\n
by[space]
, CTRL+A, CTRL+K then CTRL+F to format, then replace all{
by\n{
and replace all}
by\n}
this can be scripted to go through all files.