Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: C/C++ function parsing

by educated_foo (Vicar)
on Jan 13, 2014 at 16:56 UTC ( #1070433=note: print w/ replies, xml ) Need Help??


in reply to C/C++ function parsing

What you want will depend on what you mean by "parsing". If you want to actually pull out the separate parameters, and especially if you need to handle templates, the problem gets complicated. I'd look into just pulling code out of Inline::CPP or SWIG, since they can both handle fairly hairy declarations.

If you just need to recognize the declarations in a file, and don't care about templates, you can get away with something much simpler along the lines of what you already have, e.g. /^([\w:]+)\(([^)]*)\)/s


Comment on Re: C/C++ function parsing
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1070433]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2014-08-20 05:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (105 votes), past polls