#include "CLucene/StdHeader.h" #ifndef _lucene_queryParser_QueryParserBase_ #define _lucene_queryParser_QueryParserBase_ #include "CLucene/search/BooleanClause.h" #include "CLucene/util/VoidList.h" #include "CLucene/analysis/AnalysisHeader.h" #include "CLucene/analysis/Analyzers.h" #include "CLucene/index/Term.h" #include "CLucene/search/TermQuery.h" #include "CLucene/search/PhraseQuery.h" #include "CLucene/search/RangeQuery.h" using namespace lucene::search; using namespace lucene::util; using namespace lucene::analysis; using namespace lucene::index; namespace lucene{ namespace queryParser{ // Contains routines that used by QueryParser. class QueryParserBase { protected: static const int_t CONJ_NONE = 0; static const int_t CONJ_AND = 1; static const int_t CONJ_OR = 2; static const int_t MOD_NONE = 0; static const int_t MOD_NOT = 10; static const int_t MOD_REQ = 11; public: int_t PhraseSlop; //0 QueryParserBase(); ~QueryParserBase(); static void throwParserException(const char_t* message, char_t ch, int_t col, int_t line ); protected: // Adds the next parsed clause. void AddClause(VoidList& clauses, int_t conj, int_t mods, Query* q); // Returns a query for the specified field. Query* GetFieldQuery(const char_t* field, Analyzer& analyzer, const char_t* queryText); // Returns a range query. Query* GetRangeQuery(const char_t* field, Analyzer& analyzer, const char_t* queryText, bool inclusive); }; }} #endif