Menu

Nodefactory - PrototypicalNodeFactory

Help
Anonymous
2004-03-08
2004-03-18
  • Anonymous

    Anonymous - 2004-03-08

    what is a nodefactory? what does it do, what is a PrototypicalNodeFactory ?

    I tried to search for some docs on this but did not find much.

    Now is the above in anyway related to recursion ?

    Regards
    Suchak Jani

     
    • Derrick Oswald

      Derrick Oswald - 2004-03-08

      NodeFactory is the interface used to create new nodes in the Lexer and Parser. See the JavaDocs http://htmlparser.sourceforge.net/javadoc/index.html .

      The PrototypicalNodeFactory is a concrete implementation of that interface that works by cloning prototype tags it maintains in a list (string and remark nodes are handled separately from tags). You can add your own tags via registerTag(). Again, see the JavaDocs.

      Recursion enters into it indirectly via the scanner for composite tags (tags with the form <XXX>yy zz ...</XXX>), which may invoke tag creation and recursive scanning for it's children (the yy zz etc.).

      Derrick

       
    • Anonymous

      Anonymous - 2004-03-18

      Derrick,

      Thanks much for your reply.

      >--
      Recursion enters into it indirectly via the scanner for composite tags (tags with the form <XXX>yy zz ...</XXX>), which may invoke tag creation and recursive scanning for it's children (the yy zz etc.).
      >--

      I assume it here means the PrototypicalNodeFactory.
      Now what is the scanner ?
      How does the scanner invoke tag creation and resursion ?

      Thanks for all the help.

      Regards
      Suchak Jani

       
      • Derrick Oswald

        Derrick Oswald - 2004-03-18

        Short answer: The composite tag scanner is the one that tries to match end tags, it calls the lexer which invokes the node factory as needed to create nodes for returning. If a tag  has a scanner, it will be called inside of the other scanning process to handle nested tags: <XXX>yy zz <PPP>qq</PPP> ...</XXX>
        If the PPP scanner is the same as the XXX scanner (usually the CompositeTagScanner) it's not recursive, but the context is stacked and the same scanner just does the inner tag and returns a complete tag to the outer stack frame.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.