Namespace Lucene.Net.QueryParsers.Surround.Parser
This package contains the QueryParser.jj
source file for the Surround parser.
Parsing the text of a query results in a SrndQuery in the Lucene.Net.QueryParsers.Surround.Query namespace.
Classes
FastCharStream
An efficient implementation of JavaCC's ICharStream interface.
Note that this does not do line-number counting, but instead keeps track of the character position of the token in the input, as required by Lucene's Lucene.Net.Analysis.Token API.LexicalToken
This package contains the QueryParser.jj
source file for the Surround parser.
Parsing the text of a query results in a SrndQuery in the Lucene.Net.QueryParsers.Surround.Query namespace.
ParseException
This exception is thrown when parse errors are encountered. You can explicitly create objects of this exception type by calling the method GenerateParseException in the generated parser.
You can modify this class to customize your error reporting mechanisms so long as you retain the public fields.
QueryParser
This class is generated by JavaCC. The only method that clients should need to call is Parse(string).
This parser generates queries that make use of position information
(Span queries). It provides positional operators (w
and
n
) that accept a numeric distance, as well as boolean
operators (and
, or
, and not
,
wildcards (///
and ?
), quoting (with
"
), and boosting (via ^
).
The operators (W, N, AND, OR, NOT) can be expressed lower-cased or
upper-cased, and the non-unary operators (everything but NOT) support
both infix (a AND b AND c)
and prefix AND(a, b,
c)
notation.
The W and N operators express a positional relationship among their operands. N is ordered, and W is unordered. The distance is 1 by default, meaning the operands are adjacent, or may be provided as a prefix from 2-99. So, for example, 3W(a, b) means that terms a and b must appear within three positions of each other, or in other words, up to two terms may appear between a and b.
QueryParserConstants
Token literal values and constants. Generated by org.javacc.parser.OtherFilesGen#start()
QueryParserTokenManager
Token Manager.
RegexpToken
This package contains the QueryParser.jj
source file for the Surround parser.
Parsing the text of a query results in a SrndQuery in the Lucene.Net.QueryParsers.Surround.Query namespace.
Token
Describes the input token stream.
TokenMgrError
Token Manager Error.
Interfaces
ICharStream
This interface describes a character stream that maintains line and column number positions of the characters. It also has the capability to backup the stream to some extent. An implementation of this interface is used in the TokenManager implementation generated by JavaCCParser.
All the methods except BackUp(int) can be implemented in any fashion. BackUp(int) needs to be implemented correctly for the correct operation of the lexer. Rest of the methods are all used to get information like line number, column number and the string that constitutes a token and are not used by the lexer. Hence their implementation won't affect the generated lexer's operation.