At 10:47 AM 2001-12-10 -0500, Adam Turoff wrote:
>[...]Write a canonical POD parser that generates SAX events.  That will
>please the folks who (1) want an XML rendering and/or (2) want
>event-based parsing.  For those who want tree based parsing,
>there's always (1) Pod::POM, and (2) the option of creating an
>DOM tree from SAX events.[...]

I originally pictured this as a very monolithic module with a big "NO USER
SERVICEABLE PARTS INSIDE" sticker on the outside; I pictured it this way
because I've been burned recently by over-abstraction and over-modularization.
However, I spent a lot of last night unable to sleep (more fighting with
the cat over who gets more space on the bed -- I outmass him, but he has
claws) and staring at the ceiling, writing vague bits of code in my head;
and from what I came up with, I think it wouldn't be too hard to abstract
this pod2xml business into two bits: one that does all the tokenization
work and then all the things like L<...> parsing, E<...> resolution, =item
typing, etc. and then fires events, which some other module would then turn
into XML, either via subclassing, or via callbacks.

I don't know much about SAX (I read the specs once, but never used it, and
so I retained little of it), but from what I do sort of remember, I might
as well use SAX events as the event format as fired by the first module, so
that if anyone wanted to not generate XML, they could just use the first
module and define appropriate callbacks or concrete methods.


--
Sean M. Burke  [EMAIL PROTECTED]  http://www.spinn.net/~sburke/

Reply via email to