Function Protoytpe Identifier....

P

Pardha

Hi all,

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.


Thanks & Regards
Pardha Saradhi
 
S

santosh

Pardha said:
Hi all,

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.
 
J

Jordan Abel

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.
 
J

jacob navia

Pardha a écrit :
Hi all,

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.


Thanks & Regards
Pardha Saradhi

I can give you a C source file that will do that. This will cost you 1
day consulting fees.

jacob
 
J

John Bode

Pardha said:
Hi all,

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.


Thanks & Regards
Pardha Saradhi

The problem is that sed isn't smart enough to do that, unless your
source code is extremely simple and rigidly formatted.

What you need is a tool that actually understands the C grammar. You
can write one using lex and yacc (or their equivalents), but it's a
good weekend's worth of work.
 
S

santosh

John said:
The problem is that sed isn't smart enough to do that, unless your
source code is extremely simple and rigidly formatted.

What you need is a tool that actually understands the C grammar. You
can write one using lex and yacc (or their equivalents), but it's a
good weekend's worth of work.

Isn't that a bit of an overkill? Since the OP only wants the function
headers identified and extracted, it should probably be do-able as a
small C utility.
 
S

santosh

John said:
The problem is that sed isn't smart enough to do that, unless your
source code is extremely simple and rigidly formatted.

What you need is a tool that actually understands the C grammar. You
can write one using lex and yacc (or their equivalents), but it's a
good weekend's worth of work.

On second thoughts, ignore my previous reply. You're right. The tool
would need to know atleast some of C's grammar.
 
C

CBFalconer

Jordan said:
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. 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.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>
 
J

Jordan Abel

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
 
M

Mark McIntyre

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.

Except that somewhere SED is topical is also likely to consider perl,
python, lex, awk etc topical, and I suspect one can write some sort of
script to do this.
Mark McIntyre
 
J

Jordan Abel

Except that somewhere SED is topical is also likely to consider perl,
python, lex, awk etc topical,

Not comp.editors.batch [except possibly awk, but that's a huge stretch],
which was suggested.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top