You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by pe...@apache.org on 2003/06/20 20:55:55 UTC

cvs commit: xml-xerces/c/src/xercesc/parsers AbstractDOMParser.cpp AbstractDOMParser.hpp DOMBuilderImpl.cpp DOMBuilderImpl.hpp SAX2XMLReaderImpl.cpp SAX2XMLReaderImpl.hpp SAXParser.cpp SAXParser.hpp XercesDOMParser.cpp XercesDOMParser.hpp

peiyongz    2003/06/20 11:55:55

  Modified:    c/src/xercesc/parsers AbstractDOMParser.cpp
                        AbstractDOMParser.hpp DOMBuilderImpl.cpp
                        DOMBuilderImpl.hpp SAX2XMLReaderImpl.cpp
                        SAX2XMLReaderImpl.hpp SAXParser.cpp SAXParser.hpp
                        XercesDOMParser.cpp XercesDOMParser.hpp
  Log:
  Stateless Grammar Pool :: Part I
  
  Revision  Changes    Path
  1.45      +6 -4      xml-xerces/c/src/xercesc/parsers/AbstractDOMParser.cpp
  
  Index: AbstractDOMParser.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/parsers/AbstractDOMParser.cpp,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- AbstractDOMParser.cpp	21 May 2003 21:18:14 -0000	1.44
  +++ AbstractDOMParser.cpp	20 Jun 2003 18:55:54 -0000	1.45
  @@ -102,8 +102,9 @@
   // ---------------------------------------------------------------------------
   //  AbstractDOMParser: Constructors and Destructor
   // ---------------------------------------------------------------------------
  -AbstractDOMParser::AbstractDOMParser( XMLValidator* const valToAdopt
  -                                    , MemoryManager* const manager) :
  +AbstractDOMParser::AbstractDOMParser( XMLValidator* const   valToAdopt
  +                                    , MemoryManager* const  manager
  +                                    , XMLGrammarPool* const gramPool) :
   
     fCreateEntityReferenceNodes(true)
   , fIncludeIgnorableWhitespace(true)
  @@ -123,6 +124,7 @@
   , fURIStringPool(0)
   , fValidator(valToAdopt)
   , fMemoryManager(manager)
  +, fGrammarPool(gramPool)
   , fBufMgr(manager)
   , fInternalSubset(fBufMgr.bidOnBuffer())
   {
  @@ -149,7 +151,7 @@
   void AbstractDOMParser::initialize()
   {
       //  Create grammar resolver and string pool to pass to the scanner
  -    fGrammarResolver = new (fMemoryManager) GrammarResolver(fMemoryManager);
  +    fGrammarResolver = new (fMemoryManager) GrammarResolver(fGrammarPool, fMemoryManager);
       fURIStringPool = new (fMemoryManager) XMLStringPool(109, fMemoryManager);
   
       //  Create a scanner and tell it what validator to use. Then set us
  
  
  
  1.20      +15 -4     xml-xerces/c/src/xercesc/parsers/AbstractDOMParser.hpp
  
  Index: AbstractDOMParser.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/parsers/AbstractDOMParser.hpp,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- AbstractDOMParser.hpp	16 May 2003 21:36:59 -0000	1.19
  +++ AbstractDOMParser.hpp	20 Jun 2003 18:55:54 -0000	1.20
  @@ -82,7 +82,7 @@
   class DOMDocumentTypeImpl;
   class DOMElement;
   class GrammarResolver;
  -
  +class XMLGrammarPool;
   
   /**
     * This class implements the Document Object Model (DOM) interface.
  @@ -1307,11 +1307,16 @@
         *
         * @param valToAdopt Pointer to the validator instance to use. The
         *                   parser is responsible for freeing the memory.
  +      *
  +      * @param gramPool   Pointer to the grammar pool instance from 
  +      *                   external application (through derivatives).
  +      *                   The parser does NOT own it.
         */
       AbstractDOMParser
       (
  -          XMLValidator* const valToAdopt = 0
  -        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
  +          XMLValidator* const   valToAdopt = 0
  +        , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
  +        , XMLGrammarPool* const gramPool = 0
       );
   
       //@}
  @@ -1468,6 +1473,11 @@
       //      Buffer for storing the internal subset information.
       //      Once complete (after DOCTYPE is finished scanning), send
       //      it to DocumentType Node
  +    //
  +    //   fGrammarPool
  +    //      The grammar pool passed from external application (through derivatives).
  +    //      which could be 0, not owned.
  +    //
       // -----------------------------------------------------------------------
       bool                          fCreateEntityReferenceNodes;
       bool                          fIncludeIgnorableWhitespace;
  @@ -1487,6 +1497,7 @@
       XMLStringPool*                fURIStringPool;
       XMLValidator*                 fValidator;
       MemoryManager*                fMemoryManager;
  +    XMLGrammarPool*               fGrammarPool;
       XMLBufferMgr                  fBufMgr;
       XMLBuffer&                    fInternalSubset;
   };
  
  
  
  1.25      +5 -4      xml-xerces/c/src/xercesc/parsers/DOMBuilderImpl.cpp
  
  Index: DOMBuilderImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/parsers/DOMBuilderImpl.cpp,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- DOMBuilderImpl.cpp	16 May 2003 21:36:59 -0000	1.24
  +++ DOMBuilderImpl.cpp	20 Jun 2003 18:55:54 -0000	1.25
  @@ -87,10 +87,11 @@
   // ---------------------------------------------------------------------------
   //  DOMBuilderImpl: Constructors and Destructor
   // ---------------------------------------------------------------------------
  -DOMBuilderImpl::DOMBuilderImpl( XMLValidator* const  valToAdopt
  -                              , MemoryManager* const manager) :
  +DOMBuilderImpl::DOMBuilderImpl( XMLValidator* const   valToAdopt
  +                              , MemoryManager* const  manager
  +                              , XMLGrammarPool* const gramPool) :
   
  -AbstractDOMParser(valToAdopt, manager)
  +AbstractDOMParser(valToAdopt, manager, gramPool)
   , fAutoValidation(false)
   , fValidation(false)
   , fErrorHandler(0)
  
  
  
  1.14      +8 -3      xml-xerces/c/src/xercesc/parsers/DOMBuilderImpl.hpp
  
  Index: DOMBuilderImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/parsers/DOMBuilderImpl.hpp,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- DOMBuilderImpl.hpp	15 May 2003 18:26:50 -0000	1.13
  +++ DOMBuilderImpl.hpp	20 Jun 2003 18:55:54 -0000	1.14
  @@ -93,13 +93,18 @@
         * validation. If you don't provide a validator, a default one will
         * be created for you in the scanner.
         *
  +      * @param gramPool   Pointer to the grammar pool instance from 
  +      *                   external application.
  +      *                   The parser does NOT own it.
  +      *
         * @param valToAdopt Pointer to the validator instance to use. The
         *                   parser is responsible for freeing the memory.
         */
       DOMBuilderImpl
       (
  -          XMLValidator* const  valToAdopt = 0
  -        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
  +          XMLValidator* const   valToAdopt = 0
  +        , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
  +        , XMLGrammarPool* const gramPool = 0        
       );
   
       /**
  
  
  
  1.22      +7 -2      xml-xerces/c/src/xercesc/parsers/SAX2XMLReaderImpl.cpp
  
  Index: SAX2XMLReaderImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/parsers/SAX2XMLReaderImpl.cpp,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- SAX2XMLReaderImpl.cpp	18 May 2003 14:02:05 -0000	1.21
  +++ SAX2XMLReaderImpl.cpp	20 Jun 2003 18:55:54 -0000	1.22
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.22  2003/06/20 18:55:54  peiyongz
  + * Stateless Grammar Pool :: Part I
  + *
    * Revision 1.21  2003/05/18 14:02:05  knoaman
    * Memory manager implementation: pass per instance manager.
    *
  @@ -292,7 +295,8 @@
       chOpenSquare, chLatin_d, chLatin_t, chLatin_d, chCloseSquare, chNull
   };
   
  -SAX2XMLReaderImpl::SAX2XMLReaderImpl(MemoryManager* const manager) :
  +SAX2XMLReaderImpl::SAX2XMLReaderImpl(MemoryManager* const  manager
  +                                   , XMLGrammarPool* const gramPool):
   
       fNamespacePrefix(false)
       , fAutoValidation(false)
  @@ -317,6 +321,7 @@
       , fURIStringPool(0)
       , fValidator(0)
       , fMemoryManager(manager)
  +    , fGrammarPool(gramPool)
       , fStringBuffers(manager)
   {
       try
  @@ -341,7 +346,7 @@
   void SAX2XMLReaderImpl::initialize()
   {
       // Create grammar resolver and string pool that we pass to the scanner
  -    fGrammarResolver = new (fMemoryManager) GrammarResolver(fMemoryManager);
  +    fGrammarResolver = new (fMemoryManager) GrammarResolver(fGrammarPool, fMemoryManager);
       fURIStringPool = new (fMemoryManager) XMLStringPool(109, fMemoryManager);
   
       //  Create a scanner and tell it what validator to use. Then set us
  
  
  
  1.22      +14 -2     xml-xerces/c/src/xercesc/parsers/SAX2XMLReaderImpl.hpp
  
  Index: SAX2XMLReaderImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/parsers/SAX2XMLReaderImpl.hpp,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- SAX2XMLReaderImpl.hpp	22 May 2003 02:10:51 -0000	1.21
  +++ SAX2XMLReaderImpl.hpp	20 Jun 2003 18:55:54 -0000	1.22
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.22  2003/06/20 18:55:54  peiyongz
  + * Stateless Grammar Pool :: Part I
  + *
    * Revision 1.21  2003/05/22 02:10:51  knoaman
    * Default the memory manager.
    *
  @@ -242,6 +245,7 @@
   class LexicalHandler;
   class DeclHandler;
   class GrammarResolver;
  +class XMLGrammarPool;
   
   /**
     * This class implements the SAX2 'XMLReader' interface and should be
  @@ -273,7 +277,10 @@
       /** @name Constructors and Destructor */
       //@{
       /** The default constructor */
  -	SAX2XMLReaderImpl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
  +	SAX2XMLReaderImpl(
  +                            MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
  +                          , XMLGrammarPool* const gramPool = 0 
  +                          );
   
       /** The destructor */	
   	~SAX2XMLReaderImpl() ;
  @@ -1778,6 +1785,10 @@
       //  fHasExternalSubset
       //      Indicate if the document has external DTD subset.
       //
  +    //   fGrammarPool
  +    //      The grammar pool passed from external application (through derivatives).
  +    //      which could be 0, not owned.
  +    //
       // -----------------------------------------------------------------------
       bool                        fNamespacePrefix;
       bool                        fAutoValidation;
  @@ -1803,7 +1814,8 @@
       XMLStringPool*              fURIStringPool;
       XMLValidator*               fValidator;
       MemoryManager*              fMemoryManager;
  -    XMLBufferMgr		        fStringBuffers ;
  +    XMLGrammarPool*             fGrammarPool;
  +    XMLBufferMgr		fStringBuffers;
   	
       // -----------------------------------------------------------------------
       // internal function used to set the state of the parser
  
  
  
  1.20      +8 -3      xml-xerces/c/src/xercesc/parsers/SAXParser.cpp
  
  Index: SAXParser.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/parsers/SAXParser.cpp,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- SAXParser.cpp	18 May 2003 14:02:05 -0000	1.19
  +++ SAXParser.cpp	20 Jun 2003 18:55:54 -0000	1.20
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.20  2003/06/20 18:55:54  peiyongz
  + * Stateless Grammar Pool :: Part I
  + *
    * Revision 1.19  2003/05/18 14:02:05  knoaman
    * Memory manager implementation: pass per instance manager.
    *
  @@ -251,8 +254,9 @@
   // ---------------------------------------------------------------------------
   //  SAXParser: Constructors and Destructor
   // ---------------------------------------------------------------------------
  -SAXParser::SAXParser( XMLValidator* const  valToAdopt
  -                    , MemoryManager* const manager) :
  +SAXParser::SAXParser( XMLValidator* const   valToAdopt
  +                    , MemoryManager* const  manager
  +                    , XMLGrammarPool* const gramPool):
   
       fParseInProgress(false)
       , fElemDepth(0)
  @@ -268,6 +272,7 @@
       , fURIStringPool(0)
       , fValidator(valToAdopt)
       , fMemoryManager(manager)
  +    , fGrammarPool(gramPool)
       , fElemQNameBuf(1023, manager)
   {
       try
  @@ -293,7 +298,7 @@
   void SAXParser::initialize()
   {
       // Create grammar resolver and string pool to pass to scanner
  -    fGrammarResolver = new (fMemoryManager) GrammarResolver(fMemoryManager);
  +    fGrammarResolver = new (fMemoryManager) GrammarResolver(fGrammarPool, fMemoryManager);
       fURIStringPool = new (fMemoryManager) XMLStringPool(109, fMemoryManager);
   
       // Create our scanner and tell it what validator to use
  
  
  
  1.24      +12 -3     xml-xerces/c/src/xercesc/parsers/SAXParser.hpp
  
  Index: SAXParser.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/parsers/SAXParser.hpp,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- SAXParser.hpp	15 May 2003 18:26:50 -0000	1.23
  +++ SAXParser.hpp	20 Jun 2003 18:55:54 -0000	1.24
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.24  2003/06/20 18:55:54  peiyongz
  + * Stateless Grammar Pool :: Part I
  + *
    * Revision 1.23  2003/05/15 18:26:50  knoaman
    * Partial implementation of the configurable memory manager.
    *
  @@ -249,7 +252,7 @@
   class XMLValidator;
   class Grammar;
   class GrammarResolver;
  -
  +class XMLGrammarPool;
   
   /**
     * This class implements the SAX 'Parser' interface and should be
  @@ -302,8 +305,9 @@
         */
       SAXParser
       (
  -          XMLValidator* const  valToAdopt = 0
  -        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
  +          XMLValidator*   const valToAdopt = 0
  +        , MemoryManager*  const manager = XMLPlatformUtils::fgMemoryManager
  +        , XMLGrammarPool* const gramPool = 0 
       );
   
       /**
  @@ -2010,6 +2014,10 @@
       //      The scanner being used by this parser. It is created internally
       //      during construction.
       //
  +    //   fGrammarPool
  +    //      The grammar pool passed from external application (through derivatives).
  +    //      which could be 0, not owned.
  +    //
       // -----------------------------------------------------------------------
       bool                 fParseInProgress;
       unsigned int         fElemDepth;
  @@ -2026,6 +2034,7 @@
       XMLStringPool*       fURIStringPool;
       XMLValidator*        fValidator;
       MemoryManager*       fMemoryManager;
  +    XMLGrammarPool*      fGrammarPool;
       XMLBuffer            fElemQNameBuf;
   };
   
  
  
  
  1.13      +5 -4      xml-xerces/c/src/xercesc/parsers/XercesDOMParser.cpp
  
  Index: XercesDOMParser.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/parsers/XercesDOMParser.cpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- XercesDOMParser.cpp	15 May 2003 18:26:50 -0000	1.12
  +++ XercesDOMParser.cpp	20 Jun 2003 18:55:54 -0000	1.13
  @@ -83,10 +83,11 @@
   // ---------------------------------------------------------------------------
   //  XercesDOMParser: Constructors and Destructor
   // ---------------------------------------------------------------------------
  -XercesDOMParser::XercesDOMParser( XMLValidator* const  valToAdopt
  -                                , MemoryManager* const manager) :
  +XercesDOMParser::XercesDOMParser( XMLValidator* const   valToAdopt
  +                                , MemoryManager* const  manager
  +                                , XMLGrammarPool* const gramPool):
   
  -AbstractDOMParser(valToAdopt, manager)
  +AbstractDOMParser(valToAdopt, manager, gramPool)
   , fErrorHandler(0)
   , fEntityResolver(0)
   {
  
  
  
  1.15      +8 -3      xml-xerces/c/src/xercesc/parsers/XercesDOMParser.hpp
  
  Index: XercesDOMParser.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/parsers/XercesDOMParser.hpp,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- XercesDOMParser.hpp	15 May 2003 18:26:50 -0000	1.14
  +++ XercesDOMParser.hpp	20 Jun 2003 18:55:55 -0000	1.15
  @@ -98,13 +98,18 @@
         * validation. If you don't provide a validator, a default one will
         * be created for you in the scanner.
         *
  +      * @param gramPool   Pointer to the grammar pool instance from 
  +      *                   external application.
  +      *                   The parser does NOT own it.
  +      *
         * @param valToAdopt Pointer to the validator instance to use. The
         *                   parser is responsible for freeing the memory.
         */
       XercesDOMParser
       (
  -          XMLValidator* const  valToAdopt = 0
  -        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
  +          XMLValidator* const   valToAdopt = 0
  +        , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
  +        , XMLGrammarPool* const gramPool = 0        
       );
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org