Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Parsing C Functions..

by chromatic (Archbishop)
on Apr 27, 2008 at 19:55 UTC ( [id://683186]=note: print w/replies, xml ) Need Help??


in reply to Parsing C Functions..

The best advice anyone can give you is to use a parser, not regular expressions. While it's probably possible to build a state machine with Perl 5 regular expressions which handles all of the possible tokens and states and state transitions appropriately, no one I know capable of writing such a thing has actually done it.

You might be able to get by with regular expressions and Text::Balanced -- we use that in Parrot to build PMCs out of our PMC mini-language which includes C code -- but for anything more complex, you'll have a much easier time using a parser.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2024-04-19 18:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found