Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: looking Generic File Parser script?by tachyon (Chancellor) |
on Nov 25, 2004 at 23:44 UTC ( [id://410485]=note: print w/replies, xml ) | Need Help?? |
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
In Section
Seekers of Perl Wisdom
|
|