C::Scan module doesn't support old C function defintions...

Discussion in 'Perl Misc' started by Gancy, Mar 14, 2005.

  1. Gancy

    Gancy Guest

    Hi All,
    I wanted to parse a C program for function defintions. I checked on
    usage of C::Scan perl module, but it does not support old C style
    function defintions - something like this..

    int func(a,b,c,d)
    int a,b;
    float c;
    char *d;
    {
    ....
    ....
    }

    Is there anyway i can parse this to find the defintion. I also tried to
    right a regex for this. It does not work in all the cases as C has
    very flexible sytax. I can write same func() in different way

    int func(a,b,c,d)
    int a;
    int b;
    float c; char *d;
    {

    }

    I could not write a single regex to find a old C style function
    defintion. Could anybody give some suggestions to move me in right
    direction or a generic regex to do the job.

    Thanks
    Gancy
     
    Gancy, Mar 14, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Irmen de Jong
    Replies:
    2
    Views:
    371
    Irmen de Jong
    Nov 10, 2003
  2. Steve
    Replies:
    11
    Views:
    564
    Jim Segrave
    Jul 1, 2006
  3. Jim Hill
    Replies:
    3
    Views:
    402
    Jim Hill
    Feb 12, 2007
  4. *Prot3anThr3ad*

    old repository for old C++ source code

    *Prot3anThr3ad*, Sep 29, 2006, in forum: C++
    Replies:
    6
    Views:
    379
    *Prot3anThr3ad*
    Oct 2, 2006
  5. John Henry
    Replies:
    24
    Views:
    1,015
    alex23
    May 30, 2008
Loading...

Share This Page