Class StandardSyntaxParser
- java.lang.Object
-
- org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser
-
- All Implemented Interfaces:
SyntaxParser,StandardSyntaxParserConstants
public class StandardSyntaxParser extends java.lang.Object implements SyntaxParser, StandardSyntaxParserConstants
Parser for the standard Lucene syntax
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classStandardSyntaxParser.JJCallsprivate static classStandardSyntaxParser.LookaheadSuccess
-
Field Summary
Fields Modifier and Type Field Description private StandardSyntaxParser.JJCalls[]jj_2_rtnsprivate intjj_endposprivate java.util.List<int[]>jj_expentriesprivate int[]jj_expentryprivate intjj_gcprivate intjj_genprivate intjj_kindprivate intjj_laprivate int[]jj_la1private static int[]jj_la1_0private static int[]jj_la1_1private Tokenjj_lastposprivate int[]jj_lasttokensprivate StandardSyntaxParser.LookaheadSuccessjj_lsTokenjj_ntNext token.private intjj_ntkprivate booleanjj_rescanprivate Tokenjj_scanposTokentokenCurrent token.StandardSyntaxParserTokenManagertoken_sourceGenerated Token Manager.private booleantrace_enabledprivate inttrace_indent-
Fields inherited from interface org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParserConstants
_ESCAPED_CHAR, _NUM_CHAR, _QUOTED_CHAR, _TERM_CHAR, _TERM_START_CHAR, _WHITESPACE, AFTER, AND, ATLEAST, BEFORE, CARAT, CONTAINED_BY, CONTAINING, DEFAULT, EOF, EXTEND, FN_OR, FN_PREFIX, Function, FUZZYTERM, LPAREN, MAXGAPS, MAXWIDTH, MINUS, NON_OVERLAPPING, NOT, NOT_CONTAINED_BY, NOT_CONTAINING, NOT_WITHIN, NUMBER, OP_COLON, OP_EQUAL, OP_LESSTHAN, OP_LESSTHANEQ, OP_MORETHAN, OP_MORETHANEQ, OR, ORDERED, OVERLAPPING, PHRASE, PLUS, QUOTED, Range, RANGE_GOOP, RANGE_QUOTED, RANGE_TO, RANGEEX_END, RANGEEX_START, RANGEIN_END, RANGEIN_START, REGEXPTERM, RPAREN, TERM, TILDE, tokenImage, UNORDERED, UNORDERED_NO_OVERLAPS, WILDCARD, WITHIN
-
-
Constructor Summary
Constructors Constructor Description StandardSyntaxParser()StandardSyntaxParser(CharStream stream)Constructor with user supplied CharStream.StandardSyntaxParser(StandardSyntaxParserTokenManager tm)Constructor with generated Token Manager.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private QueryNodeBoost(QueryNode node)private QueryNodeClause(java.lang.CharSequence field)private QueryNodeConjQuery(java.lang.CharSequence field)voiddisable_tracing()Disable tracing.private QueryNodeDisjQuery(java.lang.CharSequence field)voidenable_tracing()Enable tracing.private java.lang.CharSequenceFieldName()private TermRangeQueryNodeFieldRangeExpr(java.lang.CharSequence field)private QueryNodeFuzzyOp(java.lang.CharSequence field, Token term, QueryNode node)ParseExceptiongenerateParseException()Generate ParseException.TokengetNextToken()Get the next Token.TokengetToken(int index)Get the specific Token.private QueryNodeGroupingExpr(java.lang.CharSequence field)private IntervalFunctionIntervalAfter()private IntervalFunctionIntervalAtLeast()private IntervalFunctionIntervalBefore()private IntervalFunctionIntervalContainedBy()private IntervalFunctionIntervalContaining()private IntervalQueryNodeIntervalExpr(java.lang.CharSequence field)private IntervalFunctionIntervalExtend()private IntervalFunctionIntervalFun()private IntervalFunctionIntervalFuzzyTerm()private IntervalFunctionIntervalMaxGaps()private IntervalFunctionIntervalMaxWidth()private IntervalFunctionIntervalNonOverlapping()private IntervalFunctionIntervalNotContainedBy()private IntervalFunctionIntervalNotContaining()private IntervalFunctionIntervalNotWithin()private IntervalFunctionIntervalOr()private IntervalFunctionIntervalOrdered()private IntervalFunctionIntervalOverlapping()private IntervalFunctionIntervalPhrase()private IntervalFunctionIntervalText()private IntervalFunctionIntervalUnordered()private IntervalFunctionIntervalUnorderedNoOverlaps()private IntervalFunctionIntervalWildcard()private IntervalFunctionIntervalWithin()private booleanjj_2_1(int xla)private booleanjj_2_10(int xla)private booleanjj_2_11(int xla)private booleanjj_2_12(int xla)private booleanjj_2_13(int xla)private booleanjj_2_14(int xla)private booleanjj_2_15(int xla)private booleanjj_2_16(int xla)private booleanjj_2_17(int xla)private booleanjj_2_18(int xla)private booleanjj_2_19(int xla)private booleanjj_2_2(int xla)private booleanjj_2_20(int xla)private booleanjj_2_21(int xla)private booleanjj_2_22(int xla)private booleanjj_2_23(int xla)private booleanjj_2_24(int xla)private booleanjj_2_25(int xla)private booleanjj_2_26(int xla)private booleanjj_2_27(int xla)private booleanjj_2_28(int xla)private booleanjj_2_3(int xla)private booleanjj_2_4(int xla)private booleanjj_2_5(int xla)private booleanjj_2_6(int xla)private booleanjj_2_7(int xla)private booleanjj_2_8(int xla)private booleanjj_2_9(int xla)private booleanjj_3_1()private booleanjj_3_10()private booleanjj_3_11()private booleanjj_3_12()private booleanjj_3_13()private booleanjj_3_14()private booleanjj_3_15()private booleanjj_3_16()private booleanjj_3_17()private booleanjj_3_18()private booleanjj_3_19()private booleanjj_3_2()private booleanjj_3_20()private booleanjj_3_21()private booleanjj_3_22()private booleanjj_3_23()private booleanjj_3_24()private booleanjj_3_25()private booleanjj_3_26()private booleanjj_3_27()private booleanjj_3_28()private booleanjj_3_3()private booleanjj_3_4()private booleanjj_3_5()private booleanjj_3_6()private booleanjj_3_7()private booleanjj_3_8()private booleanjj_3_9()private booleanjj_3R_10()private booleanjj_3R_11()private booleanjj_3R_12()private booleanjj_3R_13()private booleanjj_3R_14()private booleanjj_3R_15()private booleanjj_3R_16()private booleanjj_3R_17()private booleanjj_3R_18()private booleanjj_3R_19()private booleanjj_3R_20()private booleanjj_3R_21()private booleanjj_3R_22()private booleanjj_3R_23()private booleanjj_3R_24()private booleanjj_3R_25()private booleanjj_3R_26()private booleanjj_3R_27()private booleanjj_3R_28()private booleanjj_3R_29()private booleanjj_3R_30()private booleanjj_3R_31()private booleanjj_3R_32()private booleanjj_3R_33()private booleanjj_3R_34()private booleanjj_3R_35()private booleanjj_3R_36()private booleanjj_3R_37()private booleanjj_3R_38()private booleanjj_3R_39()private booleanjj_3R_40()private booleanjj_3R_41()private booleanjj_3R_42()private booleanjj_3R_43()private booleanjj_3R_44()private booleanjj_3R_45()private booleanjj_3R_46()private booleanjj_3R_47()private booleanjj_3R_9()private voidjj_add_error_token(int kind, int pos)private Tokenjj_consume_token(int kind)private static voidjj_la1_init_0()private static voidjj_la1_init_1()private intjj_ntk_f()private voidjj_rescan_token()private voidjj_save(int index, int xla)private booleanjj_scan_token(int kind)private QueryNodeModClause(java.lang.CharSequence field)QueryNodeparse(java.lang.CharSequence query, java.lang.CharSequence field)Parses a query string, returning aQueryNode.static floatparseFloat(Token token)static intparseInt(Token token)private QueryNodeQuery(java.lang.CharSequence field)private QueryNodeQuotedTerm(java.lang.CharSequence field)voidReInit(CharStream stream)Reinitialise.voidReInit(StandardSyntaxParserTokenManager tm)Reinitialise.private QueryNodeTerm(java.lang.CharSequence field)private TermRangeQueryNodeTermRangeExpr(java.lang.CharSequence field)QueryNodeTopLevelQuery(java.lang.CharSequence field)booleantrace_enabled()Trace enabled.
-
-
-
Field Detail
-
token_source
public StandardSyntaxParserTokenManager token_source
Generated Token Manager.
-
token
public Token token
Current token.
-
jj_nt
public Token jj_nt
Next token.
-
jj_ntk
private int jj_ntk
-
jj_scanpos
private Token jj_scanpos
-
jj_lastpos
private Token jj_lastpos
-
jj_la
private int jj_la
-
jj_gen
private int jj_gen
-
jj_la1
private final int[] jj_la1
-
jj_la1_0
private static int[] jj_la1_0
-
jj_la1_1
private static int[] jj_la1_1
-
jj_2_rtns
private final StandardSyntaxParser.JJCalls[] jj_2_rtns
-
jj_rescan
private boolean jj_rescan
-
jj_gc
private int jj_gc
-
jj_ls
private final StandardSyntaxParser.LookaheadSuccess jj_ls
-
jj_expentries
private java.util.List<int[]> jj_expentries
-
jj_expentry
private int[] jj_expentry
-
jj_kind
private int jj_kind
-
jj_lasttokens
private int[] jj_lasttokens
-
jj_endpos
private int jj_endpos
-
trace_indent
private int trace_indent
-
trace_enabled
private boolean trace_enabled
-
-
Constructor Detail
-
StandardSyntaxParser
public StandardSyntaxParser()
-
StandardSyntaxParser
public StandardSyntaxParser(CharStream stream)
Constructor with user supplied CharStream.
-
StandardSyntaxParser
public StandardSyntaxParser(StandardSyntaxParserTokenManager tm)
Constructor with generated Token Manager.
-
-
Method Detail
-
parse
public QueryNode parse(java.lang.CharSequence query, java.lang.CharSequence field) throws QueryNodeParseException
Parses a query string, returning aQueryNode.- Specified by:
parsein interfaceSyntaxParser- Parameters:
query- the query string to be parsed.field- - default field name- Returns:
- QueryNode tree
- Throws:
ParseException- if the parsing failsQueryNodeParseException
-
parseFloat
public static float parseFloat(Token token)
-
parseInt
public static int parseInt(Token token)
-
TopLevelQuery
public final QueryNode TopLevelQuery(java.lang.CharSequence field) throws ParseException
- Throws:
ParseException
-
Query
private final QueryNode Query(java.lang.CharSequence field) throws ParseException
- Throws:
ParseException
-
DisjQuery
private final QueryNode DisjQuery(java.lang.CharSequence field) throws ParseException
- Throws:
ParseException
-
ConjQuery
private final QueryNode ConjQuery(java.lang.CharSequence field) throws ParseException
- Throws:
ParseException
-
ModClause
private final QueryNode ModClause(java.lang.CharSequence field) throws ParseException
- Throws:
ParseException
-
Clause
private final QueryNode Clause(java.lang.CharSequence field) throws ParseException
- Throws:
ParseException
-
FieldName
private final java.lang.CharSequence FieldName() throws ParseException- Throws:
ParseException
-
GroupingExpr
private final QueryNode GroupingExpr(java.lang.CharSequence field) throws ParseException
- Throws:
ParseException
-
IntervalExpr
private final IntervalQueryNode IntervalExpr(java.lang.CharSequence field) throws ParseException
- Throws:
ParseException
-
IntervalFun
private final IntervalFunction IntervalFun() throws ParseException
- Throws:
ParseException
-
IntervalAtLeast
private final IntervalFunction IntervalAtLeast() throws ParseException
- Throws:
ParseException
-
IntervalMaxWidth
private final IntervalFunction IntervalMaxWidth() throws ParseException
- Throws:
ParseException
-
IntervalMaxGaps
private final IntervalFunction IntervalMaxGaps() throws ParseException
- Throws:
ParseException
-
IntervalUnordered
private final IntervalFunction IntervalUnordered() throws ParseException
- Throws:
ParseException
-
IntervalUnorderedNoOverlaps
private final IntervalFunction IntervalUnorderedNoOverlaps() throws ParseException
- Throws:
ParseException
-
IntervalOrdered
private final IntervalFunction IntervalOrdered() throws ParseException
- Throws:
ParseException
-
IntervalOr
private final IntervalFunction IntervalOr() throws ParseException
- Throws:
ParseException
-
IntervalPhrase
private final IntervalFunction IntervalPhrase() throws ParseException
- Throws:
ParseException
-
IntervalBefore
private final IntervalFunction IntervalBefore() throws ParseException
- Throws:
ParseException
-
IntervalAfter
private final IntervalFunction IntervalAfter() throws ParseException
- Throws:
ParseException
-
IntervalContaining
private final IntervalFunction IntervalContaining() throws ParseException
- Throws:
ParseException
-
IntervalNotContaining
private final IntervalFunction IntervalNotContaining() throws ParseException
- Throws:
ParseException
-
IntervalContainedBy
private final IntervalFunction IntervalContainedBy() throws ParseException
- Throws:
ParseException
-
IntervalNotContainedBy
private final IntervalFunction IntervalNotContainedBy() throws ParseException
- Throws:
ParseException
-
IntervalWithin
private final IntervalFunction IntervalWithin() throws ParseException
- Throws:
ParseException
-
IntervalExtend
private final IntervalFunction IntervalExtend() throws ParseException
- Throws:
ParseException
-
IntervalNotWithin
private final IntervalFunction IntervalNotWithin() throws ParseException
- Throws:
ParseException
-
IntervalOverlapping
private final IntervalFunction IntervalOverlapping() throws ParseException
- Throws:
ParseException
-
IntervalNonOverlapping
private final IntervalFunction IntervalNonOverlapping() throws ParseException
- Throws:
ParseException
-
IntervalWildcard
private final IntervalFunction IntervalWildcard() throws ParseException
- Throws:
ParseException
-
IntervalFuzzyTerm
private final IntervalFunction IntervalFuzzyTerm() throws ParseException
- Throws:
ParseException
-
IntervalText
private final IntervalFunction IntervalText() throws ParseException
- Throws:
ParseException
-
Boost
private final QueryNode Boost(QueryNode node) throws ParseException
- Throws:
ParseException
-
FuzzyOp
private final QueryNode FuzzyOp(java.lang.CharSequence field, Token term, QueryNode node) throws ParseException
- Throws:
ParseException
-
FieldRangeExpr
private final TermRangeQueryNode FieldRangeExpr(java.lang.CharSequence field) throws ParseException
- Throws:
ParseException
-
Term
private final QueryNode Term(java.lang.CharSequence field) throws ParseException
- Throws:
ParseException
-
QuotedTerm
private final QueryNode QuotedTerm(java.lang.CharSequence field) throws ParseException
- Throws:
ParseException
-
TermRangeExpr
private final TermRangeQueryNode TermRangeExpr(java.lang.CharSequence field) throws ParseException
- Throws:
ParseException
-
jj_2_1
private boolean jj_2_1(int xla)
-
jj_2_2
private boolean jj_2_2(int xla)
-
jj_2_3
private boolean jj_2_3(int xla)
-
jj_2_4
private boolean jj_2_4(int xla)
-
jj_2_5
private boolean jj_2_5(int xla)
-
jj_2_6
private boolean jj_2_6(int xla)
-
jj_2_7
private boolean jj_2_7(int xla)
-
jj_2_8
private boolean jj_2_8(int xla)
-
jj_2_9
private boolean jj_2_9(int xla)
-
jj_2_10
private boolean jj_2_10(int xla)
-
jj_2_11
private boolean jj_2_11(int xla)
-
jj_2_12
private boolean jj_2_12(int xla)
-
jj_2_13
private boolean jj_2_13(int xla)
-
jj_2_14
private boolean jj_2_14(int xla)
-
jj_2_15
private boolean jj_2_15(int xla)
-
jj_2_16
private boolean jj_2_16(int xla)
-
jj_2_17
private boolean jj_2_17(int xla)
-
jj_2_18
private boolean jj_2_18(int xla)
-
jj_2_19
private boolean jj_2_19(int xla)
-
jj_2_20
private boolean jj_2_20(int xla)
-
jj_2_21
private boolean jj_2_21(int xla)
-
jj_2_22
private boolean jj_2_22(int xla)
-
jj_2_23
private boolean jj_2_23(int xla)
-
jj_2_24
private boolean jj_2_24(int xla)
-
jj_2_25
private boolean jj_2_25(int xla)
-
jj_2_26
private boolean jj_2_26(int xla)
-
jj_2_27
private boolean jj_2_27(int xla)
-
jj_2_28
private boolean jj_2_28(int xla)
-
jj_3R_17
private boolean jj_3R_17()
-
jj_3R_25
private boolean jj_3R_25()
-
jj_3R_11
private boolean jj_3R_11()
-
jj_3R_19
private boolean jj_3R_19()
-
jj_3R_47
private boolean jj_3R_47()
-
jj_3R_16
private boolean jj_3R_16()
-
jj_3R_24
private boolean jj_3R_24()
-
jj_3R_43
private boolean jj_3R_43()
-
jj_3R_30
private boolean jj_3R_30()
-
jj_3R_14
private boolean jj_3R_14()
-
jj_3_28
private boolean jj_3_28()
-
jj_3R_23
private boolean jj_3R_23()
-
jj_3R_9
private boolean jj_3R_9()
-
jj_3R_29
private boolean jj_3R_29()
-
jj_3R_41
private boolean jj_3R_41()
-
jj_3R_37
private boolean jj_3R_37()
-
jj_3R_45
private boolean jj_3R_45()
-
jj_3R_38
private boolean jj_3R_38()
-
jj_3R_36
private boolean jj_3R_36()
-
jj_3_2
private boolean jj_3_2()
-
jj_3R_13
private boolean jj_3R_13()
-
jj_3R_35
private boolean jj_3R_35()
-
jj_3R_20
private boolean jj_3R_20()
-
jj_3_1
private boolean jj_3_1()
-
jj_3_3
private boolean jj_3_3()
-
jj_3R_34
private boolean jj_3R_34()
-
jj_3R_28
private boolean jj_3R_28()
-
jj_3R_21
private boolean jj_3R_21()
-
jj_3R_10
private boolean jj_3R_10()
-
jj_3R_12
private boolean jj_3R_12()
-
jj_3R_44
private boolean jj_3R_44()
-
jj_3_25
private boolean jj_3_25()
-
jj_3_24
private boolean jj_3_24()
-
jj_3_23
private boolean jj_3_23()
-
jj_3_22
private boolean jj_3_22()
-
jj_3_21
private boolean jj_3_21()
-
jj_3R_22
private boolean jj_3R_22()
-
jj_3_20
private boolean jj_3_20()
-
jj_3R_31
private boolean jj_3R_31()
-
jj_3_19
private boolean jj_3_19()
-
jj_3_18
private boolean jj_3_18()
-
jj_3R_40
private boolean jj_3R_40()
-
jj_3_17
private boolean jj_3_17()
-
jj_3R_39
private boolean jj_3R_39()
-
jj_3R_33
private boolean jj_3R_33()
-
jj_3_16
private boolean jj_3_16()
-
jj_3_15
private boolean jj_3_15()
-
jj_3_14
private boolean jj_3_14()
-
jj_3_13
private boolean jj_3_13()
-
jj_3_12
private boolean jj_3_12()
-
jj_3_11
private boolean jj_3_11()
-
jj_3_10
private boolean jj_3_10()
-
jj_3_9
private boolean jj_3_9()
-
jj_3R_18
private boolean jj_3R_18()
-
jj_3_8
private boolean jj_3_8()
-
jj_3_7
private boolean jj_3_7()
-
jj_3_6
private boolean jj_3_6()
-
jj_3_5
private boolean jj_3_5()
-
jj_3_4
private boolean jj_3_4()
-
jj_3_27
private boolean jj_3_27()
-
jj_3R_27
private boolean jj_3R_27()
-
jj_3_26
private boolean jj_3_26()
-
jj_3R_46
private boolean jj_3R_46()
-
jj_3R_15
private boolean jj_3R_15()
-
jj_3R_32
private boolean jj_3R_32()
-
jj_3R_42
private boolean jj_3R_42()
-
jj_3R_26
private boolean jj_3R_26()
-
jj_la1_init_0
private static void jj_la1_init_0()
-
jj_la1_init_1
private static void jj_la1_init_1()
-
ReInit
public void ReInit(CharStream stream)
Reinitialise.
-
ReInit
public void ReInit(StandardSyntaxParserTokenManager tm)
Reinitialise.
-
jj_consume_token
private Token jj_consume_token(int kind) throws ParseException
- Throws:
ParseException
-
jj_scan_token
private boolean jj_scan_token(int kind)
-
getNextToken
public final Token getNextToken()
Get the next Token.
-
getToken
public final Token getToken(int index)
Get the specific Token.
-
jj_ntk_f
private int jj_ntk_f()
-
jj_add_error_token
private void jj_add_error_token(int kind, int pos)
-
generateParseException
public ParseException generateParseException()
Generate ParseException.
-
trace_enabled
public final boolean trace_enabled()
Trace enabled.
-
enable_tracing
public final void enable_tracing()
Enable tracing.
-
disable_tracing
public final void disable_tracing()
Disable tracing.
-
jj_rescan_token
private void jj_rescan_token()
-
jj_save
private void jj_save(int index, int xla)
-
-