ParserState.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
// Copyright (c) 1994 James Clark
// See the file COPYING for copying permission.
#pragma ident "%Z%%M% %I% %E% SMI"
#ifndef ParserState_INCLUDED
#define ParserState_INCLUDED 1
#ifdef __GNUG__
#pragma interface
#endif
#include <stddef.h>
#include <signal.h>
#include "Allocator.h"
#include "Attribute.h"
#include "Boolean.h"
#include "Vector.h"
#include "StringC.h"
#include "Dtd.h"
#include "Entity.h"
#include "EntityCatalog.h"
#include "EntityManager.h"
#include "Event.h"
#include "EventQueue.h"
#include "Id.h"
#include "InputSource.h"
#include "IList.h"
#include "IQueue.h"
#include "Location.h"
#include "Message.h"
#include "Mode.h"
#include "OpenElement.h"
#include "OutputState.h"
#include "ParserOptions.h"
#include "Ptr.h"
#include "Recognizer.h"
#include "Sd.h"
#include "Syntax.h"
#include "NCVector.h"
#include "Owner.h"
#include "Lpd.h"
#include "LpdEntityRef.h"
#include "Markup.h"
#include "ContentState.h"
#ifdef SP_NAMESPACE
#endif
enum Phase {
};
const ParserOptions &,
unsigned subdocLevel,
void unsetHandler();
Boolean inInstance() const;
void allDone();
void endDtd();
void startInstance();
unsigned subdocLevel() const;
Boolean haveDefLpd() const;
Boolean haveCurrentDtd() const;
const Dtd ¤tDtd() const;
Dtd ¤tDtdNonConst() const;
void endLpd();
size_t nActiveLink() const;
void activateLinkType(const StringC &);
void allLinkTypesActivated();
void setResultAttributeSpecMode();
void clearResultAttributeSpecMode();
Boolean haveApplicableDtd() const;
void setPass2Start();
void checkEntityStability();
Char currentChar() const;
const Location ¤tLocation() const;
InputSource *currentInput() const;
EntityManager &entityManager() const;
const EntityCatalog &entityCatalog() const;
const Syntax &instanceSyntax() const;
Phase finalPhase() const;
Mode currentMode() const;
void skipChar();
StringC currentToken() const;
void getCurrentToken(StringC &) const;
unsigned inputLevel() const;
unsigned specialParseInputLevel() const;
unsigned markedSectionLevel() const;
unsigned markedSectionSpecialLevel() const;
unsigned currentInputElementIndex() const;
const Location ¤tMarkedSectionStartLocation() const;
void popInputStack();
void pushInput(InputSource *);
Boolean eventQueueEmpty() const;
Event *eventQueueGet();
void pushElement(OpenElement *);
void popElement();
void pcdataRecover();
Boolean pcdataRecovering() const;
const Location &,
const Location &);
void startMarkedSection(const Location &);
void endMarkedSection();
void noteMarkup();
void noteData();
void noteRs();
// size of objects allocated with this must not exceed
// sizeof(StartElementEvent)
// size of objects allocated with this must not exceed
// sizeof(OpenElement)
unsigned i);
static void freeEvent(void *);
Boolean wantMarkup() const;
const EventsWanted &eventsWanted() const;
StringC &nameBuffer();
const ParserOptions &options() const;
void enableImplydef();
void keepMessages();
void releaseKeptMessages();
void discardKeptMessages();
Markup *currentMarkup();
const Location &markupLocation() const;
// AFDR extensions
void setHadAfdrDecl();
Boolean hadAfdrDecl() const;
// Implementation of AttributeContext.
const Location &);
const Location &);
const Syntax &attributeSyntax() const;
void dispatchMessage(Message &);
void dispatchMessage(const Message &);
void initMessage(Message &);
void queueMessage(MessageEvent *);
unsigned subdocLevel_;
// external entity to be referenced at the end of the declaration subset
// if in a special parse (cdata, rcdata, ignore), the input level
// at which the special parse started.
unsigned specialParseInputLevel_;
unsigned markedSectionLevel_;
unsigned markedSectionSpecialLevel_;
unsigned inputLevel_;
const volatile sig_atomic_t *cancelPtr_;
static sig_atomic_t dummyCancel_;
static const Location nullLocation_;
};
inline
{
return *this;
}
inline
{
return (inInstance_
}
inline
{
return options_.eventsWanted;
}
inline
{
return inputStack_.head();
}
inline
{
}
inline
{
return pcdataRecovering_;
}
inline
unsigned ParserState::inputLevel() const
{
return inputLevel_;
}
inline
unsigned ParserState::specialParseInputLevel() const
{
return specialParseInputLevel_;
}
inline
unsigned ParserState::markedSectionLevel() const
{
return markedSectionLevel_;
}
inline
unsigned ParserState::markedSectionSpecialLevel() const
{
return markedSectionSpecialLevel_;
}
inline
{
return markedSectionStartLocation_.back();
}
inline
unsigned ParserState::currentInputElementIndex() const
{
return inputLevelElementIndex_.back();
}
inline
{
return currentInput()->currentTokenStart()[0];
}
inline
{
currentInput()->currentTokenLength());
}
inline
{
}
inline
{
recognizers_[mode] = p;
}
inline
{
normalMap_ = map;
}
inline
{
return normalMap_;
}
inline
{
}
inline
{
return !currentDtd_.isNull();
}
inline
{
return *defDtd_;
}
inline
{
return *currentDtd_;
}
inline
{
return *currentDtd_;
}
inline
{
return defDtd_;
}
inline
{
return currentDtdConst_;
}
inline
{
return inInstance_;
}
inline
{
return *syntax_;
}
inline
{
return *instanceSyntax_;
}
inline
{
return syntax_;
}
inline
{
return instanceSyntax_;
}
inline
{
return prologSyntax_;
}
inline
{
return *sd_;
}
inline
{
return sd_;
}
inline
{
}
inline
{
return currentMode_;
}
inline
{
}
inline
void ParserState::skipChar()
{
(void)getChar();
}
inline
{
}
inline
{
}
inline
{
return eventQueue_.empty();
}
inline
{
return eventQueue_.get();
}
inline
{
return phase_;
}
inline
{
return finalPhase_;
}
inline
{
return *entityManager_;
}
inline
{
return entityManager_;
}
inline
{
return *entityCatalog_;
}
inline
{
return entityCatalog_;
}
inline
{
}
inline
{
}
inline
{
return eventAllocator_;
}
inline
{
return internalAllocator_;
}
inline
{
return nameBuffer_;
}
inline
const volatile sig_atomic_t *cancelPtr)
{
}
inline
void ParserState::unsetHandler()
{
handler_ = &eventQueue_;
}
inline
{
location);
}
inline
void ParserState::noteMarkup()
{
if (inInstance_)
}
inline
void ParserState::noteRs()
{
}
inline
{
}
inline
{
}
inline
void ParserState::noteData()
{
}
inline
unsigned ParserState::subdocLevel() const
{
return subdocLevel_;
}
inline
{
return *handler_;
}
inline
{
// Avoid use of typedef to work around MSVC 2.0 bug.
}
inline
{
return options_;
}
inline
{
return implydefElement_;
}
inline
{
return implydefAttlist_;
}
inline
void ParserState::enableImplydef()
{
implydefElement_ = 1;
implydefAttlist_ = 1;
}
inline
void ParserState::keepMessages()
{
keepingMessages_ = 1;
}
inline
{
return !currentDtd_.isNull();
}
inline
{
return hadLpd_;
}
inline
{
return pass2_;
}
inline
{
}
inline
{
return *lpd_[i];
}
inline
{
return *defLpd_;
}
inline
{
return defLpd_;
}
inline
{
}
inline
{
return (ComplexLpd &)defLpd();
}
inline
{
return dtd_[0];
else
}
inline
{
}
inline
{
}
inline
{
return currentMarkup_;
}
inline
{
return markupLocation_;
}
inline
{
if (storing) {
return currentMarkup_ = &markup_;
}
else
return currentMarkup_ = 0;
}
inline
{
return *cancelPtr_ != 0;
}
inline
void ParserState::setHadAfdrDecl()
{
hadAfdrDecl_ = 1;
}
inline
{
return hadAfdrDecl_;
}
#ifdef SP_NAMESPACE
}
#endif
#endif /* not ParserState_INCLUDED */