On 2006-03-21, CBFalconer <> wrote:
> Jordan Abel wrote:
>> On 2006-03-21, santosh <> wrote:
>>> Pardha wrote:
>>>>
>>>> I am lookig for a SED script file which parses any .C source
>>>> code file to pick up all the funcions that are defined in it.
>>>> The functions are to be identified and are supposed to be moved
>>>> in to another file with two columns...the function name and the
>>>> number of arguments the function is being passed to.
>>>>
>>>> i would be glad if any of the users wud supply me the relevant
>>>> scripts...as soon as possible.
>>>
>>> This is the wrong group. Try comp.editors, alt.comp.editors.batch,
>>> comp.unix.shell etc.
>>
>> For what it's worth, what he's asking for is impossible, so it
>> doesn't matter where he posts it.
>
> With a sed script, yes. However it is quite possible with the aid
> of a lexical scanner and some elementary symbol table
> creation/lookup/manipulation.
Well, yeah - I didn't mean the task was impossible entirely, after all,
compilers do it. but sed can't do it. so pointing him to somewhere that
sed is more on-topic isn't really helpful.
> The guts of such a package would be quite useful for various purposes.
> The front end would also have to handle macro expansion, possibly on a
> switch, so that functional macros could appear as functions.
You'd also have to deal with conditional compilation, or you might trip
over unbalanced braces
|