Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: looking Generic File Parser script?

by tachyon (Chancellor)
on Nov 25, 2004 at 23:44 UTC ( #410485=note: print w/replies, xml ) Need Help??


in reply to looking Generic File Parser script?

As noted you want a recursive descent parser like Parse::RecDescent. A parser needs a grammar. Fortunately the Inline:: modules all use PRD to parse the language code so you have a good start on a C grammar in Inline::C::ParseRecDescent and a C++ grammar in Inline::CPP::Grammar

You do not want to generate a HASH as this is unordered, whereas code is definitively ordered. You want what PRD gives you which is an array of array refs to whatever depth. You may find the thread Parse:RecDescent grammar help useful.

cheers

tachyon

  • Comment on Re: looking Generic File Parser script?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://410485]
help
Chatterbox?
[1nickt]: choroba no kidding! The muscle memory alone makes it insignificant. I suppose the addition of param checking is nice. But if you are using MOo anyway you are using Type::Tiny, and you can easily use T::T for params in regular methods.

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2017-11-24 13:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (349 votes). Check out past polls.

    Notices?