|
xapian-core
2.0.0
|
build a Xapian::Query object from a user query string More...
#include <config.h>#include "queryparser_internal.h"#include "api/queryinternal.h"#include "omassert.h"#include "str.h"#include "stringutils.h"#include "xapian/error.h"#include "xapian/unicode.h"#include "queryparser_token.h"#include "word-breaker.h"#include <algorithm>#include <cstring>#include <limits>#include <list>#include <string>#include <string_view>#include <vector>#include "debuglog.h"
Include dependency graph for queryparser_internal.cc:Go to the source code of this file.
Classes | |
| class | Term |
| Class used to pass information about a token from lexer to parser. More... | |
| class | State |
| Parser State shared between the lexer and the parser. More... | |
| class | SynonymIterator |
| struct | ProbQuery |
| class | TermGroup |
| A group of terms separated only by whitespace. More... | |
| class | Terms |
| Some terms which form a positional sub-query. More... | |
| union | YYMINORTYPE |
| struct | yyStackEntry |
| struct | yyParser |
Macros | |
| #define | Parse_ENGINEALWAYSONSTACK |
| #define | VET_BOOL_ARGS(A, B, OP_TXT) |
| #define | INTERFACE 1 |
| #define | YYCODETYPE unsigned char |
| #define | YYNOCODE 42 |
| #define | YYACTIONTYPE unsigned char |
| #define | ParseTOKENTYPE Term * |
| #define | YYSTACKDEPTH 100 |
| #define | ParseARG_SDECL State * state; |
| #define | ParseARG_PDECL ,State * state |
| #define | ParseARG_FETCH State * state = yypParser->state |
| #define | ParseARG_STORE yypParser->state = state |
| #define | YYNSTATE 42 |
| #define | YYNRULE 59 |
| #define | YYNTOKEN 26 |
| #define | YY_MAX_SHIFT 41 |
| #define | YY_MIN_SHIFTREDUCE 83 |
| #define | YY_MAX_SHIFTREDUCE 141 |
| #define | YY_ERROR_ACTION 142 |
| #define | YY_ACCEPT_ACTION 143 |
| #define | YY_NO_ACTION 144 |
| #define | YY_MIN_REDUCE 145 |
| #define | YY_MAX_REDUCE 203 |
| #define | yytestcase(X) |
| #define | YY_ACTTAB_COUNT (352) |
| #define | YY_SHIFT_COUNT (41) |
| #define | YY_SHIFT_MIN (0) |
| #define | YY_SHIFT_MAX (339) |
| #define | YY_REDUCE_COUNT (16) |
| #define | YY_REDUCE_MIN (-36) |
| #define | YY_REDUCE_MAX (301) |
| #define | YYMALLOCARGTYPE size_t |
| #define | yyTraceShift(X, Y, Z) |
| #define | TOKEN yyminor |
Typedefs | |
| typedef struct yyParser | yyParser |
Functions | |
| bool | U_isupper (unsigned ch) |
| bool | U_isdigit (unsigned ch) |
| bool | U_isalpha (unsigned ch) |
| bool | is_not_whitespace (unsigned ch) |
| bool | is_not_wordchar (unsigned ch) |
| bool | is_digit (unsigned ch) |
| bool | is_suffix (unsigned ch) |
| bool | is_double_quote (unsigned ch) |
| bool | prefix_needs_colon (const string &prefix, unsigned ch) |
| bool | is_positional (Xapian::Query::op op) |
| static void | add_to_query (Query *&q, Query::op op, Query *term) |
| static void | add_to_query (Query *&q, Query::op op, const Query &term) |
| bool | is_phrase_generator (unsigned ch) |
| bool | is_stem_preventer (unsigned ch) |
| bool | should_stem (const string &term, const State &state) |
| unsigned | check_infix (unsigned ch) |
| unsigned | check_infix_digit (unsigned ch) |
| static void | yy_parse_failed (yyParser *) |
| bool | is_extended_wildcard (unsigned ch, unsigned flags) |
| static void | ParseInit (yyParser *pParser) |
| static void | ParseFinalize (yyParser *pParser) |
| static void | yy_destructor (yyParser *yypParser, YYCODETYPE yymajor, YYMINORTYPE *yypminor) |
| static void | yy_pop_parser_stack (yyParser *pParser) |
| static unsigned int | yy_find_shift_action (yyParser *pParser, YYCODETYPE iLookAhead) |
| static int | yy_find_reduce_action (int stateno, YYCODETYPE iLookAhead) |
| static void | yy_shift (yyParser *yypParser, int yyNewState, int yyMajor, ParseTOKENTYPE yyMinor) |
| static void | yy_accept (yyParser *) |
| static void | yy_reduce (yyParser *yypParser, unsigned int yyruleno, int yyLookahead, ParseTOKENTYPE yyLookaheadToken) |
| static void | yy_syntax_error (yyParser *yypParser, int yymajor, ParseTOKENTYPE yyminor) |
| static void | Parse (yyParser *yypParser, int yymajor, ParseTOKENTYPE yyminor ParseARG_PDECL) |
Variables | |
| static constexpr unsigned | NO_EDIT_DISTANCE = unsigned(-1) |
| static constexpr unsigned | DEFAULT_EDIT_DISTANCE = 2 |
| const unsigned | UNICODE_IGNORE = numeric_limits<unsigned>::max() |
| Value representing "ignore this" when returned by check_infix() or check_infix_digit(). More... | |
| static const YYACTIONTYPE | yy_action [] |
| static const YYCODETYPE | yy_lookahead [] |
| static const unsigned short int | yy_shift_ofst [] |
| static const short | yy_reduce_ofst [] |
| static const YYACTIONTYPE | yy_default [] |
| struct { | |
| YYCODETYPE lhs | |
| signed char nrhs | |
| } | yyRuleInfo [] |
build a Xapian::Query object from a user query string
Definition in file queryparser_internal.cc.
| #define INTERFACE 1 |
Definition at line 1616 of file queryparser_internal.cc.
| #define Parse_ENGINEALWAYSONSTACK |
Definition at line 78 of file queryparser_internal.cc.
| #define ParseARG_FETCH State * state = yypParser->state |
Definition at line 1637 of file queryparser_internal.cc.
| #define ParseARG_PDECL ,State * state |
Definition at line 1636 of file queryparser_internal.cc.
| #define ParseARG_SDECL State * state; |
Definition at line 1635 of file queryparser_internal.cc.
| #define ParseARG_STORE yypParser->state = state |
Definition at line 1638 of file queryparser_internal.cc.
| #define ParseTOKENTYPE Term * |
Definition at line 1622 of file queryparser_internal.cc.
| #define TOKEN yyminor |
Definition at line 1549 of file queryparser_internal.cc.
| #define YY_ACCEPT_ACTION 143 |
Definition at line 1646 of file queryparser_internal.cc.
| #define YY_ACTTAB_COUNT (352) |
Definition at line 1715 of file queryparser_internal.cc.
| #define YY_ERROR_ACTION 142 |
Definition at line 1645 of file queryparser_internal.cc.
| #define YY_MAX_REDUCE 203 |
Definition at line 1649 of file queryparser_internal.cc.
| #define YY_MAX_SHIFT 41 |
Definition at line 1642 of file queryparser_internal.cc.
| #define YY_MAX_SHIFTREDUCE 141 |
Definition at line 1644 of file queryparser_internal.cc.
| #define YY_MIN_REDUCE 145 |
Definition at line 1648 of file queryparser_internal.cc.
| #define YY_MIN_SHIFTREDUCE 83 |
Definition at line 1643 of file queryparser_internal.cc.
| #define YY_NO_ACTION 144 |
Definition at line 1647 of file queryparser_internal.cc.
| #define YY_REDUCE_COUNT (16) |
Definition at line 1803 of file queryparser_internal.cc.
| #define YY_REDUCE_MAX (301) |
Definition at line 1805 of file queryparser_internal.cc.
| #define YY_REDUCE_MIN (-36) |
Definition at line 1804 of file queryparser_internal.cc.
| #define YY_SHIFT_COUNT (41) |
Definition at line 1793 of file queryparser_internal.cc.
| #define YY_SHIFT_MAX (339) |
Definition at line 1795 of file queryparser_internal.cc.
| #define YY_SHIFT_MIN (0) |
Definition at line 1794 of file queryparser_internal.cc.
| #define YYACTIONTYPE unsigned char |
Definition at line 1621 of file queryparser_internal.cc.
| #define YYCODETYPE unsigned char |
Definition at line 1619 of file queryparser_internal.cc.
| #define YYMALLOCARGTYPE size_t |
Definition at line 2037 of file queryparser_internal.cc.
| #define YYNOCODE 42 |
Definition at line 1620 of file queryparser_internal.cc.
| #define YYNRULE 59 |
Definition at line 1640 of file queryparser_internal.cc.
| #define YYNSTATE 42 |
Definition at line 1639 of file queryparser_internal.cc.
| #define YYNTOKEN 26 |
Definition at line 1641 of file queryparser_internal.cc.
| #define YYSTACKDEPTH 100 |
Definition at line 1633 of file queryparser_internal.cc.
| #define yytestcase | ( | X | ) |
Definition at line 1661 of file queryparser_internal.cc.
| #define yyTraceShift | ( | X, | |
| Y, | |||
| Z | |||
| ) |
Definition at line 2407 of file queryparser_internal.cc.
Definition at line 1872 of file queryparser_internal.cc.
Definition at line 513 of file queryparser_internal.cc.
References term.
Definition at line 495 of file queryparser_internal.cc.
Referenced by Terms::as_opwindow_query(), and yy_reduce().
|
inline |
Definition at line 695 of file queryparser_internal.cc.
References UNICODE_IGNORE.
Referenced by Xapian::QueryParser::Internal::parse_term(), and Xapian::parse_terms().
|
inline |
Definition at line 722 of file queryparser_internal.cc.
References UNICODE_IGNORE.
Referenced by Xapian::QueryParser::Internal::parse_term(), and Xapian::parse_terms().
|
inline |
Definition at line 117 of file queryparser_internal.cc.
References Xapian::Unicode::DECIMAL_DIGIT_NUMBER, and Xapian::Unicode::Internal::get_category().
Referenced by Xapian::QueryParser::Internal::parse_term(), and Xapian::parse_terms().
|
inline |
Definition at line 132 of file queryparser_internal.cc.
Referenced by Xapian::QueryParser::Internal::parse_query().
|
inline |
Definition at line 929 of file queryparser_internal.cc.
Referenced by Xapian::QueryParser::Internal::parse_query(), and Xapian::QueryParser::Internal::parse_term().
|
inline |
Definition at line 105 of file queryparser_internal.cc.
References Xapian::Unicode::is_whitespace().
Referenced by Xapian::QueryParser::Internal::parse_query().
|
inline |
Definition at line 112 of file queryparser_internal.cc.
References Xapian::Unicode::is_wordchar().
Referenced by Xapian::QueryParser::Internal::parse_query().
|
inline |
Definition at line 669 of file queryparser_internal.cc.
Referenced by Xapian::QueryParser::Internal::parse_query().
|
inline |
Definition at line 153 of file queryparser_internal.cc.
References Xapian::Query::OP_NEAR, and Xapian::Query::OP_PHRASE.
Referenced by TermGroup::as_group(), State::State(), and yy_reduce().
|
inline |
Definition at line 678 of file queryparser_internal.cc.
Referenced by Xapian::QueryParser::Internal::parse_query().
|
inline |
Definition at line 127 of file queryparser_internal.cc.
Referenced by Xapian::QueryParser::Internal::parse_term().
|
static |
Definition at line 3209 of file queryparser_internal.cc.
References Assert, LOGLINE, ParseARG_STORE, YYMINORTYPE::yy0, yy_accept(), YY_ACCEPT_ACTION, yy_destructor(), YY_ERROR_ACTION, yy_find_reduce_action(), yy_find_shift_action(), YY_MAX_SHIFTREDUCE, YY_MIN_REDUCE, yy_parse_failed(), yy_pop_parser_stack(), yy_reduce(), yy_shift(), yy_syntax_error(), YYCODETYPE, yyParser::yyerrcnt, YYNOCODE, and yyParser::yystack.
Referenced by Xapian::QueryParser::Internal::parse_query().
|
static |
Definition at line 2209 of file queryparser_internal.cc.
References yy_pop_parser_stack(), and yyParser::yystack.
Referenced by yyParser::~yyParser().
|
static |
Definition at line 2043 of file queryparser_internal.cc.
References yyParser::yyerrcnt, yyParser::yystack, and YYSTACKDEPTH.
Referenced by yyParser::yyParser().
|
inline |
Definition at line 143 of file queryparser_internal.cc.
References U_isupper().
Referenced by Terms::as_synonym_phrase_query(), Term::get_query_with_synonyms(), and Term::make_term().
|
inline |
Definition at line 684 of file queryparser_internal.cc.
References Xapian::Unicode::Internal::get_category(), State::should_stem_mask, and term.
Referenced by Xapian::TermGenerator::Internal::index_text(), and Xapian::QueryParser::Internal::parse_query().
|
inline |
Definition at line 98 of file queryparser_internal.cc.
Referenced by Xapian::QueryParser::Internal::parse_query().
|
inline |
Definition at line 93 of file queryparser_internal.cc.
Referenced by Xapian::QueryParser::Internal::parse_query(), and Xapian::QueryParser::Internal::parse_term().
|
inline |
Definition at line 88 of file queryparser_internal.cc.
Referenced by Xapian::QueryParser::Internal::parse_term(), Xapian::parse_terms(), and prefix_needs_colon().
|
static |
Definition at line 3173 of file queryparser_internal.cc.
References AssertEq, LOGLINE, ParseARG_FETCH, ParseARG_STORE, yyParser::yyerrcnt, and yyParser::yystack.
Referenced by Parse().
|
static |
Definition at line 2097 of file queryparser_internal.cc.
References ParseARG_FETCH, ParseARG_STORE, YYMINORTYPE::yy0, YYMINORTYPE::yy1, YYMINORTYPE::yy18, YYMINORTYPE::yy32, and YYMINORTYPE::yy36.
Referenced by Parse(), yy_pop_parser_stack(), and yy_reduce().
|
static |
Definition at line 2342 of file queryparser_internal.cc.
References Assert, yy_action, YY_ACTTAB_COUNT, yy_default, yy_lookahead, YY_REDUCE_COUNT, yy_reduce_ofst, and YYNOCODE.
Referenced by Parse(), and yy_reduce().
|
static |
Definition at line 2280 of file queryparser_internal.cc.
References Assert, LOGLINE, yy_action, YY_ACTTAB_COUNT, yy_default, yy_lookahead, YY_MAX_SHIFT, YY_SHIFT_COUNT, YY_SHIFT_MAX, YY_SHIFT_MIN, yy_shift_ofst, YYCODETYPE, YYNOCODE, YYNTOKEN, and yyParser::yystack.
Referenced by Parse().
|
static |
Definition at line 3130 of file queryparser_internal.cc.
References LOGLINE, ParseARG_FETCH, ParseARG_STORE, yy_pop_parser_stack(), and yyParser::yystack.
Referenced by Parse(), yy_reduce(), and yy_syntax_error().
|
static |
Definition at line 2196 of file queryparser_internal.cc.
References Assert, LOGLINE, yyStackEntry::major, yyStackEntry::minor, yy_destructor(), and yyParser::yystack.
Referenced by Parse(), ParseFinalize(), and yy_parse_failed().
|
static |
Definition at line 2512 of file queryparser_internal.cc.
References ProbQuery::add_filter(), ProbQuery::add_filter_range(), Terms::add_positional_term(), TermGroup::add_term(), add_to_query(), Terms::adjust_window(), ProbQuery::append_filter(), ProbQuery::append_filter_range(), Terms::as_adj_query(), TermGroup::as_group(), Terms::as_near_query(), Terms::as_phrase_query(), Terms::as_synonym_phrase_query(), Assert, Terms::create(), TermGroup::create(), Xapian::Query::empty(), ProbQuery::filter, ProbQuery::hate, is_positional(), LOGLINE, ProbQuery::love, yyStackEntry::major, ProbQuery::merge_filters(), yyStackEntry::minor, nrhs, ParseARG_FETCH, ProbQuery::query, TermGroup::set_empty_ok(), yyStackEntry::stateno, UNSIGNED_OVERFLOW_OK, VET_BOOL_ARGS, YYMINORTYPE::yy0, YYMINORTYPE::yy1, YYMINORTYPE::yy18, YYMINORTYPE::yy32, YYMINORTYPE::yy36, yy_destructor(), YY_ERROR_ACTION, yy_find_reduce_action(), YY_MAX_SHIFT, YY_MAX_SHIFTREDUCE, yy_parse_failed(), YYACTIONTYPE, YYCODETYPE, yyRuleInfo, yyParser::yystack, yytestcase, and yyTraceShift.
Referenced by Parse().
|
static |
Definition at line 2413 of file queryparser_internal.cc.
References YY_MAX_SHIFT, YY_MIN_REDUCE, YY_MIN_SHIFTREDUCE, yyParser::yystack, and yyTraceShift.
Referenced by Parse().
|
static |
Definition at line 3152 of file queryparser_internal.cc.
References ParseARG_FETCH, ParseARG_STORE, and yy_parse_failed().
Referenced by Parse().
|
staticconstexpr |
Definition at line 85 of file queryparser_internal.cc.
Referenced by Xapian::QueryParser::Internal::parse_term().
| YYCODETYPE lhs |
Definition at line 2436 of file queryparser_internal.cc.
|
staticconstexpr |
Definition at line 84 of file queryparser_internal.cc.
Referenced by Xapian::QueryParser::Internal::parse_query().
| signed char nrhs |
Definition at line 2437 of file queryparser_internal.cc.
Referenced by yy_reduce().
| const unsigned UNICODE_IGNORE = numeric_limits<unsigned>::max() |
Value representing "ignore this" when returned by check_infix() or check_infix_digit().
Definition at line 693 of file queryparser_internal.cc.
Referenced by check_infix(), Xapian::check_infix(), check_infix_digit(), Xapian::check_infix_digit(), Xapian::QueryParser::Internal::parse_term(), and Xapian::parse_terms().
|
static |
Definition at line 1716 of file queryparser_internal.cc.
Referenced by yy_find_reduce_action(), and yy_find_shift_action().
|
static |
Definition at line 1810 of file queryparser_internal.cc.
Referenced by yy_find_reduce_action(), and yy_find_shift_action().
|
static |
Definition at line 1754 of file queryparser_internal.cc.
Referenced by yy_find_reduce_action(), and yy_find_shift_action().
|
static |
Definition at line 1806 of file queryparser_internal.cc.
Referenced by yy_find_reduce_action().
|
static |
Definition at line 1796 of file queryparser_internal.cc.
Referenced by yy_find_shift_action().
| const { ... } yyRuleInfo[] |
Referenced by yy_reduce().