1 /*------------------------------------------------------------------------------
2 * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
3 *
4 * Distributable under the terms of either the Apache License (Version 2.0) or
5 * the GNU Lesser General Public License, as specified in the COPYING file.
6 ------------------------------------------------------------------------------*/
7 #ifndef _lucene_queryParser_legacy_QueryToken_
8 #define _lucene_queryParser_legacy_QueryToken_
9
CL_NS_DEF2(queryParser,legacy)10 CL_NS_DEF2(queryParser,legacy)
11
12 // Token class that used by QueryParser.
13 class CLUCENE_EXPORT QueryToken:LUCENE_BASE
14 {
15 public:
16 enum Types
17 {
18 AND_,
19 OR,
20 NOT,
21 PLUS,
22 MINUS,
23 LPAREN,
24 RPAREN,
25 COLON,
26 CARAT,
27 QUOTED,
28 TERM,
29 SLOP,
30 FUZZY,
31 PREFIXTERM,
32 WILDTERM,
33 RANGEIN,
34 RANGEEX,
35 NUMBER,
36 EOF_,
37 UNKNOWN_
38 };
39
40
41 #ifdef LUCENE_TOKEN_WORD_LENGTH
42 TCHAR Value[LUCENE_TOKEN_WORD_LENGTH+1];
43 #else
44 TCHAR* Value;
45 #endif
46
47 int32_t Start;
48 int32_t End;
49 QueryToken::Types Type;
50
51 // Initializes a new instance of the Token class.
52 QueryToken(const TCHAR* value, const int32_t start, const int32_t end, const Types type);
53
54 // Initializes a new instance of the Token class.
55 QueryToken(const TCHAR* value, const Types type);
56
57 // Initializes a new instance of the Token class.
58 QueryToken(Types type);
59
60 // Initializes an empty instance of the Token class.
61 QueryToken();
62
63 ~QueryToken();
64
65 void set(const TCHAR* value, const int32_t start, const int32_t end, const Types type);
66 void set(const TCHAR* value, const Types type);
67 void set(Types type);
68 };
69 CL_NS_END2
70 #endif
71