nsDTDContext*       mHeadContext;
CLASS_EXPORT_HTMLPARS COtherDTD : public nsIDTD {#if defined(XP_PC)#pragma warning( default : 4275 )#endif  public:    /**      *  Common constructor for navdtd. You probably want to call  	  *  NS_NewNavHTMLDTD().	    *       *  @update  gess 7/9/98      */    COtherDTD();    /**     *  Virtual destructor -- you know what to do     *  @update  gess 7/9/98     */    virtual ~COtherDTD();    virtual const nsIID&  GetMostDerivedIID(void) const;    /**     * Call this method if you want the DTD to construct a clone of itself.     * @update	gess7/23/98     * @param      * @return     */    virtual nsresult CreateNewInstance(nsIDTD** aInstancePtrResult);    NS_DECL_ISUPPORTS    /**     * This method is called to determine if the given DTD can parse     * a document of a given source-type.      * Note that parsing assumes that the end result will always be stored 	   * in the main content model. Of course, it's up to you which content-	   * model you pass in to the parser, so you can always control the process.	   *     * @update	gess 7/15/98     * @param	aContentType contains the name of a filetype that you are   	 *			being asked to parse).     * @return  TRUE if this DTD parse the given type; FALSE otherwise.     */    virtual eAutoDetectResult CanParse(CParserContext& aParserContext,nsString& aBuffer, PRInt32 aVersion);    /**     * Called by the parser to initiate dtd verification of the     * internal context stack.     * @update	gess 7/23/98     * @param      * @return     */    virtual PRBool Verify(nsString& aURLRef,nsIParser* aParser);       /**      * The parser uses a code sandwich to wrap the parsing process. Before      * the process begins, WillBuildModel() is called. Afterwards the parser      * calls DidBuildModel().       * @update	rickg 03.20.2000      * @param	aParserContext      * @param	aSink      * @return	error code (almost always 0)      */    NS_IMETHOD WillBuildModel(  const CParserContext& aParserContext,nsIContentSink* aSink);    /**      * The parser uses a code sandwich to wrap the parsing process. Before      * the process begins, WillBuildModel() is called. Afterwards the parser      * calls DidBuildModel().       * @update	gess5/18/98      * @param	aFilename is the name of the file being parsed.      * @return	error code (almost always 0)      */    NS_IMETHOD BuildModel(nsIParser* aParser,nsITokenizer* aTokenizer,nsITokenObserver* anObserver=0,nsIContentSink* aSink=0);   /**     * The parser uses a code sandwich to wrap the parsing process. Before     * the process begins, WillBuildModel() is called. Afterwards the parser     * calls DidBuildModel().      * @update	gess5/18/98     * @param	anErrorCode contans the last error that occured     * @return	error code     */    NS_IMETHOD DidBuildModel(nsresult anErrorCode,PRBool aNotifySink,nsIParser* aParser,nsIContentSink* aSink=0);    /**     *  This method is called by the parser, once for each token	   *	that has been constructed during the tokenization phase.     *  @update  gess 3/25/98     *  @param   aToken -- token object to be put into content model     *  @return  0 if all is well; non-zero is an error     */    NS_IMETHOD HandleToken(CToken* aToken,nsIParser* aParser);    /**     *      * @update	gess12/28/98     * @param      * @return     */    NS_IMETHOD  GetTokenizer(nsITokenizer*& aTokenizer);        /**     *      * @update	gess12/28/98     * @param      * @return     */    virtual  nsITokenRecycler* GetTokenRecycler(void);    /**     * If the parse process gets interrupted, this method gets called	   * prior to the process resuming.     * @update	gess5/18/98     * @return	error code -- usually NS_OK (0)     */    NS_IMETHOD WillResumeParse(void);    /**     * If the parse process is about to be interrupted, this method	   * will be called just prior.     * @update	gess5/18/98     * @return	error code  -- usually NS_OK (0)     */    NS_IMETHOD WillInterruptParse(void);    /**     *  This method is called to determine whether or not a tag     *  of one type can contain a tag of another type.     *       *  @update  gess 3/25/98     *  @param   aParent -- int tag of parent container     *  @param   aChild -- int tag of child container     *  @return  PR_TRUE if parent can contain child     */    virtual PRBool CanContain(PRInt32 aParent,PRInt32 aChild) const;    /**     *  This method gets called to determine whether a given      *  tag is itself a container     *       *  @update  gess 3/25/98     *  @param   aTag -- tag to test for containership     *  @return  PR_TRUE if given tag can contain other tags     */    virtual PRBool IsContainer(PRInt32 aTag) const;    /**     * Ask parser if a given container is open ANYWHERE on stack     * @update	gess5/11/98     * @param   id of container you want to test for     * @return  TRUE if the given container type is open -- otherwise FALSE     */    virtual PRBool HasOpenContainer(eHTMLTags aContainer) const;    /**     * Ask parser if a given container is open ANYWHERE on stack     * @update	gess5/11/98     * @param   id of container you want to test for     * @return  TRUE if the given container type is open -- otherwise FALSE     */    virtual PRBool HasOpenContainer(const eHTMLTags aTagSet[],PRInt32 aCount) const;    /**     * Use this id you want to stop the building content model     * --------------[ Sets DTD to STOP mode ]----------------     * It's recommended to use this method in accordance with     * the parser's terminate() method.     *     * @update	harishd 07/22/99      * @param      * @return     */    virtual nsresult  Terminate(nsIParser* aParser=nsnull) { return mDTDState=NS_ERROR_HTMLPARSER_STOPPARSING; }    /**     * Give rest of world access to our tag enums, so that CanContain(), etc,     * become useful.     */    NS_IMETHOD StringTagToIntTag(nsString &aTag, PRInt32* aIntTag) const;    NS_IMETHOD IntTagToStringTag(PRInt32 aIntTag, nsString& aTag) const;    NS_IMETHOD ConvertEntityToUnicode(const nsString& aEntity, PRInt32* aUnicode) const;    /**     * The following set of methods are used to partially construct      * the content model (via the sink) according to the type of token.     * @update	gess5/11/98     * @param   aToken is the token (of a given type) to be handled     * @return  error code representing construction state; usually 0.     */    nsresult    HandleStartToken(CToken* aToken);    nsresult    HandleEndToken(CToken* aToken);    nsresult    HandleDocTypeDeclToken(CToken* aToken);    //*************************************************    //these cover methods mimic the sink, and are used    //by the parser to manage its context-stack.    //*************************************************        /**     * The special purpose methods automatically close     * one or more open containers.     * @update	gess5/11/98     * @return  error code - 0 if all went well.     */    nsresult CloseContainer(const nsIParserNode *aNode,eHTMLTags aTarget,PRBool aClosedByStartTag);    nsresult CloseContainersTo(eHTMLTags aTag,PRBool aClosedByStartTag);    nsresult CloseContainersTo(PRInt32 anIndex,eHTMLTags aTag,PRBool aClosedByStartTag);    static void ReleaseTable(void);protected:		nsresult        CollectAttributes(nsCParserNode& aNode,eHTMLTags aTag,PRInt32 aCount);		nsresult        CollectSkippedContent(nsCParserNode& aNode,PRInt32& aCount);    nsresult        WillHandleStartTag(CToken* aToken,eHTMLTags aChildTag,nsCParserNode& aNode);    nsresult        DidHandleStartTag(nsCParserNode& aNode,eHTMLTags aChildTag);    nsCParserNode*  CreateNode(void);    void            RecycleNode(nsCParserNode* aNode);    void            RecycleNodes(nsEntryStack *aNodeStack);    nsIHTMLContentSink* mSink;    nsDTDContext*       mHeadContext;    nsDTDContext*       mBodyContext;    nsDTDContext*       mFormContext;    PRBool              mHasOpenForm;    PRBool              mHasOpenMap;    PRInt32             mHasOpenHead;    PRBool              mHasOpenBody;    PRBool              mHadFrameset;    PRBool              mHadBody;    nsString            mFilename;    nsIDTDDebug*		    mDTDDebug;    PRInt32             mLineNumber;    nsParser*           mParser;    nsITokenizer*       mTokenizer;    CTokenRecycler*     mTokenRecycler;    nsDeque             mMisplacedContent;    nsDeque             mSkippedContent;    PRBool              mHasOpenScript;    PRBool              mSaveBadTokens;    eHTMLTags           mSkipTarget;    nsDeque             mSharedNodes;    nsresult            mDTDState;    nsDTDMode           mDTDMode;    eParserCommands     mParserCommand;   //tells us to viewcontent/viewsource/viewerrors...    PRUint32            mComputedCRC32;    PRUint32            mExpectedCRC32;    nsAutoString        mScratch;  //used for various purposes; non-persistent    PRBool              mStyleHandlingEnabled;    PRBool              mEnableStrict;    eParserDocType      mDocType;#ifdef NS_DEBUG    PRInt32 gNodeCount;#endif};