Re: [Htmlparser-developer] lexer integration
Brought to you by:
derrickoswald
From: Joshua K. <jo...@in...> - 2003-10-22 22:50:26
|
Derrick Oswald wrote: > I think the duplication is because the lexer.nodes package nodes don't > use the NodeVisitor pattern and the htmlparser package nodes do. The > lexer is shipped as a separate jar so it needs nodes that don't drag > in the composite node stuff, whcih happens if the NodeVisitor > signature is included. This may be factored out if we get rid of > visitLinkTag, visitorImageTag and visitorTitleTag from that > interface. These may best be handled by direct examination of the > node name in the various visitor classes. Yeah, as I said in another thread, the NodeVisitor ought not to be dependent on scanners (or, in the future, what prototypable tags are present in some collection). That is, it shouldn't have methods on it that visit types which may not be available. So I'm in favor of a simple, narrow NodeVisitor interface - just letting one visit the basic types. > The composite tag recursion happens on the scanTagNode method which > does need a lexer, so the create calls can take just a Page, like you > say. Sounds good. regards jk |