NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Designing a parser/builder combo (Score:2)
- Parser module - has a base set of things it can parse plus some sort of registration method(s) to add new parseable things. Presumably the registering code provides a regex and an event name. This would probably be implemented by sublcassing.
- When a match is encountered, the parser just generates an event describing the match. This event is passed on to the output generator(s), which do whatever they want with it.
This nicely separates parsing from ou