Location.cxx revision 7c478bd95313f5f23a4c958a745db2134aa03244
// Copyright (c) 1994 James Clark
// See the file COPYING for copying permission.
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __GNUG__
#pragma implementation
#endif
#include "splib.h"
#include "Location.h"
#include "Entity.h"
#include "Mutex.h"
#ifdef SP_NAMESPACE
namespace SP_NAMESPACE {
#endif
class InputSourceOriginImpl : public EntityOrigin {
public:
const ExternalInfo *externalInfo() const;
void setExternalInfo(ExternalInfo *);
virtual InputSourceOrigin *copy() const;
const InputSourceOrigin *asInputSourceOrigin() const;
private:
void operator=(const InputSourceOriginImpl &); // undefined
};
class EntityOriginImpl : public InputSourceOriginImpl {
public:
}
}
void operator delete(void *p) {
}
const Location &refLocation);
~EntityOriginImpl();
InputSourceOrigin *copy() const;
const EntityDecl *entityDecl() const;
const EntityOrigin *asEntityOrigin() const;
private:
void operator=(const EntityOriginImpl &); // undefined
// total length of reference
// (characters that were replaced by the entity)
};
{
}
{
}
{
}
{
}
{
return 0;
}
{
return 0;
}
{
return 0;
}
{
return 0;
}
{
return 0;
}
{
return 0;
}
{
return 0;
}
{
return 0;
}
{
return 0;
}
{
return 0;
}
{
return 0;
}
{
return 0;
}
{
return 0;
}
{
return ind;
}
{
if (ent)
else
return 0;
}
{
}
{
return loc_;
}
{
}
{
}
{
return new InputSourceOriginImpl;
}
{
return new InputSourceOriginImpl(refLocation);
}
{
}
{
}
{
return this;
}
{
return externalInfo_.pointer();
}
{
return new InputSourceOriginImpl(refLocation_);
}
{
return refLocation_;
}
{
}
const NamedCharRef &ref)
{
}
// Number of character references whose replacement index < ind.
{
size_t i;
// Find i such that
// charRefs_[I].replacementIndex >= ind
// charRefs_[i - 1].replacementIndex < ind
// This will be a common case, so optimize it.
else {
// Binary search
// Invariant:
// charRefs_ < i have replacementIndex < ind
// charRefs_ >= lim have replacementIndex >= ind
i = 0;
while (i < lim) {
else
i = mid + 1;
}
}
return i;
}
{
for (;;) {
break;
--n;
}
}
// charRefs[n - 1].replacementIndex < ind
}
{
charRefs_[n].refEndType,
: charRefOrigNames_.size())
- charRefs_[n].origNameOffset);
return 1;
}
return 0;
}
{
}
const Location &refLocation)
{
}
const Location &refLocation,
{
}
const Location &refLocation,
{
}
const Location &refLocation)
{
}
{
}
const Location &refLocation)
{
}
const Location &refLocation,
{
}
{
}
{
if (markup_)
}
{
return refLength_;
}
{
return this;
}
{
return 0;
if (!internal)
return 0;
}
{
}
{
}
{
}
{
return loc_;
}
{
s = &origChar_;
return 1;
}
{
}
{
return loc_;
}
{
s = origChars_.data();
return 1;
}
{
}
{
return origin_->asEntityOrigin();
}
{
return origin_->asInputSourceOrigin();
}
{
}
{
}
{
}
{
return origin_->inBracketedTextOpenDelim();
}
{
return origin_->inBracketedTextCloseDelim();
}
{
}
{
}
{
return origin_->entityDecl();
}
{
}
{
}
{
}
{
return origin_->externalInfo();
}
{
}
{
}
{
}
{
}
{
}
#ifdef SP_NAMESPACE
}
#endif