2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: TrieBuilder.h /main/1 1996/07/29 17:06:48 cde-hp $ */
24 // Copyright (c) 1994 James Clark
25 // See the file COPYING for copying permission.
27 #ifndef TrieBuilder_INCLUDED
28 #define TrieBuilder_INCLUDED 1
40 namespace SP_NAMESPACE {
45 typedef Vector<Token> TokenVector;
46 TrieBuilder(int nCodes);
47 void recognize(const String<EquivCode> &chars,
50 TokenVector &ambiguities);
51 void recognize(const String<EquivCode> &chars,
52 const String<EquivCode> &set,
55 TokenVector &ambiguities);
56 // recognize a delimiter with a blank sequence
57 void recognizeB(const String<EquivCode> &chars,
58 int bSequenceLength, // >= 1
59 size_t maxBlankSequenceLength,
60 const String<EquivCode> &blankCodes,
61 const String<EquivCode> &chars2,
63 TokenVector &ambiguities);
64 void recognizeEE(EquivCode code, Token t);
65 Trie *extractTrie() { return root_.extract(); }
67 TrieBuilder(const TrieBuilder &); // undefined
68 void operator=(const TrieBuilder &); // undefined
73 const String<EquivCode> &blankCodes,
74 const String<EquivCode> &chars2,
77 TokenVector &ambiguities);
78 Trie *extendTrie(Trie *, const String<EquivCode> &);
79 void setToken(Trie *trie, int tokenLength, Token token, Priority::Type pri,
80 TokenVector &ambiguities);
82 Trie *forceNext(Trie *trie, EquivCode);
83 void copyInto(Trie *, const Trie *, int);
93 #endif /* not TrieBuilder_INCLUDED */