ssriganesh has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to parse the C/C++ code functions declarations. All is well till I have the function declaration in a single line.
But when the declarations spans more than a line regex fails to detect those functions.
The regex I am using is as below.
if(!$test && (/([:\w]+)\((.*\))/) )
Can I get some help me in this parsing.
Detected function : static gboolean g::ber_read(wtap *wth, int *err)
Not Detected function: static void ber_set_pkthdr(struct wtap_pkthdr *phdr,
int packet_size)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: C/C++ function parsing
by AnomalousMonk (Archbishop) on Jan 12, 2014 at 21:24 UTC | |
|
Re: C/C++ function parsing
by kcott (Archbishop) on Jan 13, 2014 at 04:39 UTC | |
by ssriganesh (Initiate) on Jan 13, 2014 at 08:14 UTC | |
by ImJustAFriend (Scribe) on Jan 13, 2014 at 12:56 UTC | |
by kcott (Archbishop) on Jan 13, 2014 at 13:41 UTC | |
by ssriganesh (Initiate) on Jan 15, 2014 at 06:55 UTC | |
|
Re: C/C++ function parsing
by educated_foo (Vicar) on Jan 13, 2014 at 16:56 UTC |