TrieBuilder.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 "types.h"
#include "macros.h"
#include "StringOf.h"
#include "Trie.h"
#include "TrieBuilder.h"
#include "Priority.h"
#include <stdlib.h>
#ifdef SP_NAMESPACE
namespace SP_NAMESPACE {
#endif
{
if (next_)
delete [] next_;
}
{
if (t.next_) {
for (int i = 0; i < nCodes_; i++)
}
else
next_ = 0;
}
{
if (next_)
delete [] next_;
tokenLength_ = t.tokenLength_;
if (t.next_) {
for (int i = 0; i < nCodes_; i++)
}
else
next_ = 0;
return *this;
}
{
root_->tokenLength_ = 0;
}
Token t,
{
}
Token t,
{
}
int bSequenceLength,
{
}
{
}
int tokenLength,
int minBLength,
{
b->maxBlanksToScan_ = maxLength;
b->additionalLength_ = tokenLength;
b->tokenLength_ = 0;
b->token_ = 0;
}
else {
// A B sequence is not allowed to be adjacent to a character
// that can occur in a blank sequence, so maxLength will be
// the same at a node, no matter how we got there.
}
else
pri,
}
else {
if (minBLength == 0)
tokenLength + 1,
maxLength - 1,
pri,
}
}
{
return trie;
}
int tokenLength,
{
}
}
for (int i = 0; i < nCodes_; i++)
}
}
{
}
for (int i = 0; i < nCodes_; i++)
}
{
}
for (int i = 0; i < nCodes_; i++) {
if (b && b->codeIsBlank(i))
? blankOwner.extract()
: new BlankTrie(*b));
}
if (b)
// -1 because 1 was added above
}
}
#ifdef SP_NAMESPACE
}
#endif