|Do you know where your variables are?|
Re: regex 2 find C function dependenciesby perlmonkey (Hermit)
|on Sep 20, 2003 at 06:16 UTC||Need Help??|
I just went through a similar exercise myself. I did not find C::Scan to be useful, and Parse::RecDescent can do it, but
probably too much work for your needs.
You really want to use Regexp::Common here.
Something like this should get you started:
This will match things like if( !foo ) though, so you will probably have to explicitly skip built-in keywords like that.
Note that this is certainly not a complete solution for you, but just to point out Regexp::Common is a handy tool that should help.
Also you probably want to strip out all the comments first, so they dont throw off your matching regex. But this can also be done with Regexp::Common: