#include "CLucene/StdHeader.h" #ifndef _lucene_queryParser_QueryParser_ #define _lucene_queryParser_QueryParser_ #include "QueryParserConstants.h" #include "CLucene/analysis/AnalysisHeader.h" #include "CLucene/util/Reader.h" #include "CLucene/search/SearchHeader.h" #include "CLucene/index/Term.h" #include "TokenList.h" #include "QueryToken.h" #include "QueryParserBase.h" #include "Lexer.h" using namespace lucene::util; using namespace lucene::index; using namespace lucene::analysis; using namespace lucene::search; namespace lucene{ namespace queryParser{ //
It's a query parser. // The only method that clients should need to call is Parse(). // The syntax for query const char_t*s is as follows: // A Query is a series of clauses. A clause may be prefixed by:
//// A clause may be either:
//// Thus, in BNF, the query grammar is:
//
// Query ::= ( Clause )*
// Clause ::= ["+", "-"] [<TERM> ":"] ( <TERM> | "(" Query ")" )
//
// // Examples of appropriately formatted queries can be found in the test cases. //
// class QueryParser : public QueryParserBase { private: Analyzer& analyzer; const char_t* field; TokenList* tokens; public: // Initializes a new instance of the QueryParser class with a specified field and // analyzer values. QueryParser(const char_t* _field, Analyzer& _analyzer); ~QueryParser(); // Returns a new instance of the QueryParser class with a specified query, field and // analyzer values. // The query to parse. // The default field for query terms. // Used to find terms in the query text. //