On 18/03/03 23:23 +0000, Clark C. Evans wrote:
> On Tue, Mar 18, 2003 at 02:03:37PM -0800, Colin Meyer wrote:
> | > Unfortunately, Reader is almost always coupled with Writer,
> | > java.io.Reader/java.io.Writer being but one of many examples.
> | > So, rather than call it a Writer, I've been using Emitter
> | > I tend to think of Emit not in the Radiological sense, but
> | > rather with the second more 'legal' meaning:
> | >
> | > To issue with authority; to voice; express an idea.
> | In the Perl world (XML::SAX, XML::SAX::Base and associated modules),
> | code that creates SAX events is often called the "driver", and code that
> | receives such events is called the "handler". Most drivers are parsers,
> | but that is not exclusive (a contrary example could be a module that
> | queries a database, and generates SAX events based on results). Modules
> | that are simultaneously handlers and drivers are typically called
> | "filters".
> Thanks for the suggestions. On further reading, it seems that
> Microsoft's XML implementation is using Reader/Writer... so perhaps
> I was too quick to dismiss this pair. Reader has the added advantage
> of allowing Parser and Lexer to be distinct sub-components. Well...
> this part of the spec is about to go through one-more-small-rewrite,
> so what do we think?
> On to your suggestions...
> The difficulty with Driver is that the diagram is trying to convey
> a path from a flow of characters into a native data structure
> and then back. So, for this context, Driver is a bit too generic,
> although it'd be a great name for the Interface that a parser
> I have a deeper problem with Handler, not only doesn't it convey
> that the target is text characters, but it goes on to imply a
> particular flow control -- push style, where the Handler is composed
> of a set of callbacks which are pushed events. Even though push
> parsers are easier to write than Pull parsers, I'd rather not have
> this bias enter the spec. Once again, YamlHandler is probably a
> great name for a "push" interface.
> | In *nix command pipelines, the similar terms would be "source",
> | "filter" and "sink".
> Sink is pretty neat. I like the streaming implications. But,
> once again, both source and sink kinda imply a program rather
> than something which converts text into a node stream or takes
> a node stream and makes text.
> Your feedback is really helpful; perhaps 'emitter' is too ugly.
> Brian/Oren is YamlReader YamlWriter better?
AFAIAC, Parser and Emitter are excellent terms. I've always liked them.