Re: Lacing C/C++ code (Larry Drebes)
Mon, 15 Nov 1993 12:08:22 GMT

          From comp.compilers

Related articles
Lacing C/C++ code (1993-11-14)
Re: Lacing C/C++ code (1993-11-15)
Re: Lacing C/C++ code (Prashant V Hedaoo) (1993-11-16)
Re: Lacing C/C++ code (1993-11-29)
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Larry Drebes)
Keywords: C, C++, parse, comment
Organization: Compilers Central
References: 93-11-092
Date: Mon, 15 Nov 1993 12:08:22 GMT

: and spits out

: void bob(void)
: {
: FUNC_START("bob");
: ...
: FUNC_END("bob");
: }

A quick and dirty way is to run your code through a beautifier (indent)
and then cheat knowing that any { in the first column is the start of a
function, 1 line up is the function name, and the following } in column 1
is the end of the function.

Also of interest is gcc has a __FUNCTION macro that expands at compile
time (as opposed to pre-process time).

Also of interest is the standard unix utility called ctrace, you might
find the source and be able to slim it down.

One more idea, use ctags to get a xreference of function starts and then
use that to modifiy the code.

An emacs guru can probably do what you want with in a couple lines
of elisp.

[Again, I'd pay attention to things that look like function definitions
but aren't, quite. -John]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.