I'm maintaining a software project with 134 C++ files, some of
them huge (as much as 10,000 lines each), and very few prototypes.
The author's attitude towards prototypes was like this:
Prototypes are only good for headers to be included in
other files. For functions which call each other inside
one file, such as A calls B which calls C and D,
just define the functions in order D, C, B, A, and you'll
never need prototypes.
:-(
(All in the global namespace, alas.)
So now a typical file in this project has 9834 lines and 82
functions, with no prototypes anywhere. I don't even know
what functions are there in many cases.
SO... how do I quickly, easily generate lists of function
prototypes for all 134 source files in this project?
Does anyone know of any free Sed, Awk, or perl scripts for
this? Or perhaps a small executable? Something small,
simple, open-source, and free would be especially nice.
I'd write it myself in Perl, but my Perl's weak and this
basically needs to be something like a C++ compiler
front-end, which can recognize the beginning of each
function definition and just parrot the part up to (but
not including) the "{", and type a ";" at the end. Not
exactly trivial to write.
--
Robbie Hatley
Tustin, CA, USA
lonewolfintj atsign pacbell period net
home period pacbell period net slantbar earnur slantbar
them huge (as much as 10,000 lines each), and very few prototypes.
The author's attitude towards prototypes was like this:
Prototypes are only good for headers to be included in
other files. For functions which call each other inside
one file, such as A calls B which calls C and D,
just define the functions in order D, C, B, A, and you'll
never need prototypes.
:-(
(All in the global namespace, alas.)
So now a typical file in this project has 9834 lines and 82
functions, with no prototypes anywhere. I don't even know
what functions are there in many cases.
SO... how do I quickly, easily generate lists of function
prototypes for all 134 source files in this project?
Does anyone know of any free Sed, Awk, or perl scripts for
this? Or perhaps a small executable? Something small,
simple, open-source, and free would be especially nice.
I'd write it myself in Perl, but my Perl's weak and this
basically needs to be something like a C++ compiler
front-end, which can recognize the beginning of each
function definition and just parrot the part up to (but
not including) the "{", and type a ";" at the end. Not
exactly trivial to write.
--
Robbie Hatley
Tustin, CA, USA
lonewolfintj atsign pacbell period net
home period pacbell period net slantbar earnur slantbar
Comment