“However, I do want to point the OP fairly-specifically in this fruitful direction. Very-carefully explore the possibility of using Parse::RecDescent, letting it drive the show, having been given a grammar that teaches it to “skip over” (without further definition) sections of source-code that are not of interest.
In several very-key ways, P::RD is not implemented in the same way as are classical parsers. (Hint: it is centered on regular expressions at all levels ...) Plus, it translates your grammar into a Perl source program. This gives you significant opportunities not found elsewhere.