Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
antlr3.com.google.gerrit.index.query.QueryLexer Maven / Gradle / Ivy
package com.google.gerrit.index.query;
import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;
@SuppressWarnings ("all" )
public class QueryLexer extends Lexer {
public static final int EOF=-1 ;
public static final int T__16=16 ;
public static final int T__17=17 ;
public static final int T__18=18 ;
public static final int AND=4 ;
public static final int COLON=5 ;
public static final int DEFAULT_FIELD=6 ;
public static final int ESCAPE=7 ;
public static final int EXACT_PHRASE=8 ;
public static final int FIELD_NAME=9 ;
public static final int LOWERCASE_AND_UNDERSCORE=10 ;
public static final int NON_WORD=11 ;
public static final int NOT=12 ;
public static final int OR=13 ;
public static final int SINGLE_WORD=14 ;
public static final int WS=15 ;
@Override
public void displayRecognitionError (String[] tokenNames,
RecognitionException e) {
String hdr = getErrorHeader(e);
String msg = getErrorMessage(e, tokenNames);
throw new QueryParser.QueryParseInternalException(hdr + " " + msg);
}
public Lexer[] getDelegates() {
return new Lexer[] {};
}
public QueryLexer () {}
public QueryLexer (CharStream input) {
this (input, new RecognizerSharedState());
}
public QueryLexer (CharStream input, RecognizerSharedState state) {
super (input,state);
}
@Override public String getGrammarFileName () { return "antlr3/com/google/gerrit/index/query/Query.g" ; }
public final void mT__16 () throws RecognitionException {
try {
int _type = T__16;
int _channel = DEFAULT_TOKEN_CHANNEL;
{
match('(' );
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
public final void mT__17 () throws RecognitionException {
try {
int _type = T__17;
int _channel = DEFAULT_TOKEN_CHANNEL;
{
match(')' );
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
public final void mT__18 () throws RecognitionException {
try {
int _type = T__18;
int _channel = DEFAULT_TOKEN_CHANNEL;
{
match('-' );
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
public final void mAND () throws RecognitionException {
try {
int _type = AND;
int _channel = DEFAULT_TOKEN_CHANNEL;
int alt1=2 ;
int LA1_0 = input.LA(1 );
if ( (LA1_0=='A' ) ) {
alt1=1 ;
}
else if ( (LA1_0=='a' ) ) {
alt1=2 ;
}
else {
NoViableAltException nvae =
new NoViableAltException("" , 1 , 0 , input);
throw nvae;
}
switch (alt1) {
case 1 :
{
match("AND" );
}
break ;
case 2 :
{
match("and" );
}
break ;
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
public final void mOR () throws RecognitionException {
try {
int _type = OR;
int _channel = DEFAULT_TOKEN_CHANNEL;
int alt2=2 ;
int LA2_0 = input.LA(1 );
if ( (LA2_0=='O' ) ) {
alt2=1 ;
}
else if ( (LA2_0=='o' ) ) {
alt2=2 ;
}
else {
NoViableAltException nvae =
new NoViableAltException("" , 2 , 0 , input);
throw nvae;
}
switch (alt2) {
case 1 :
{
match("OR" );
}
break ;
case 2 :
{
match("or" );
}
break ;
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
public final void mNOT () throws RecognitionException {
try {
int _type = NOT;
int _channel = DEFAULT_TOKEN_CHANNEL;
int alt3=2 ;
int LA3_0 = input.LA(1 );
if ( (LA3_0=='N' ) ) {
alt3=1 ;
}
else if ( (LA3_0=='n' ) ) {
alt3=2 ;
}
else {
NoViableAltException nvae =
new NoViableAltException("" , 3 , 0 , input);
throw nvae;
}
switch (alt3) {
case 1 :
{
match("NOT" );
}
break ;
case 2 :
{
match("not" );
}
break ;
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
public final void mCOLON () throws RecognitionException {
try {
int _type = COLON;
int _channel = DEFAULT_TOKEN_CHANNEL;
{
match(':' );
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
public final void mWS () throws RecognitionException {
try {
int _type = WS;
int _channel = DEFAULT_TOKEN_CHANNEL;
{
if ( (input.LA(1 ) >= '\t' && input.LA(1 ) <= '\n' )||input.LA(1 )=='\r' ||input.LA(1 )==' ' ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null ,input);
recover(mse);
throw mse;
}
_channel=HIDDEN;
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
public final void mLOWERCASE_AND_UNDERSCORE () throws RecognitionException {
try {
{
int cnt4=0 ;
loop4:
while (true ) {
int alt4=2 ;
int LA4_0 = input.LA(1 );
if ( (LA4_0=='_' ||(LA4_0 >= 'a' && LA4_0 <= 'z' )) ) {
alt4=1 ;
}
switch (alt4) {
case 1 :
{
if ( input.LA(1 )=='_' ||(input.LA(1 ) >= 'a' && input.LA(1 ) <= 'z' ) ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null ,input);
recover(mse);
throw mse;
}
}
break ;
default :
if ( cnt4 >= 1 ) break loop4;
EarlyExitException eee = new EarlyExitException(4 , input);
throw eee;
}
cnt4++;
}
}
}
finally {
}
}
public final void mFIELD_NAME () throws RecognitionException {
try {
int _type = FIELD_NAME;
int _channel = DEFAULT_TOKEN_CHANNEL;
{
mLOWERCASE_AND_UNDERSCORE();
loop5:
while (true ) {
int alt5=2 ;
int LA5_0 = input.LA(1 );
if ( (LA5_0=='-' ) ) {
alt5=1 ;
}
switch (alt5) {
case 1 :
{
match('-' );
mLOWERCASE_AND_UNDERSCORE();
}
break ;
default :
break loop5;
}
}
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
public final void mEXACT_PHRASE () throws RecognitionException {
try {
int _type = EXACT_PHRASE;
int _channel = DEFAULT_TOKEN_CHANNEL;
int i;
final StringBuilder buf = new StringBuilder();
int alt8=2 ;
int LA8_0 = input.LA(1 );
if ( (LA8_0=='\"' ) ) {
alt8=1 ;
}
else if ( (LA8_0=='{' ) ) {
alt8=2 ;
}
else {
NoViableAltException nvae =
new NoViableAltException("" , 8 , 0 , input);
throw nvae;
}
switch (alt8) {
case 1 :
{
match('\"' );
loop6:
while (true ) {
int alt6=3 ;
int LA6_0 = input.LA(1 );
if ( (LA6_0=='\\' ) ) {
alt6=1 ;
}
else if ( ((LA6_0 >= '\u0000' && LA6_0 <= '!' )||(LA6_0 >= '#' && LA6_0 <= '[' )||(LA6_0 >= ']' && LA6_0 <= '\uFFFF' )) ) {
alt6=2 ;
}
switch (alt6) {
case 1 :
{
mESCAPE(buf);
}
break ;
case 2 :
{
i= input.LA(1 );
if ( (input.LA(1 ) >= '\u0000' && input.LA(1 ) <= '!' )||(input.LA(1 ) >= '#' && input.LA(1 ) <= '[' )||(input.LA(1 ) >= ']' && input.LA(1 ) <= '\uFFFF' ) ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null ,input);
recover(mse);
throw mse;
}
buf.appendCodePoint(i);
}
break ;
default :
break loop6;
}
}
match('\"' );
setText(buf.toString());
}
break ;
case 2 :
{
match('{' );
loop7:
while (true ) {
int alt7=3 ;
int LA7_0 = input.LA(1 );
if ( (LA7_0=='\\' ) ) {
alt7=1 ;
}
else if ( ((LA7_0 >= '\u0000' && LA7_0 <= '[' )||(LA7_0 >= ']' && LA7_0 <= 'z' )||LA7_0=='|' ||(LA7_0 >= '~' && LA7_0 <= '\uFFFF' )) ) {
alt7=2 ;
}
switch (alt7) {
case 1 :
{
mESCAPE(buf);
}
break ;
case 2 :
{
i= input.LA(1 );
if ( (input.LA(1 ) >= '\u0000' && input.LA(1 ) <= '[' )||(input.LA(1 ) >= ']' && input.LA(1 ) <= 'z' )||input.LA(1 )=='|' ||(input.LA(1 ) >= '~' && input.LA(1 ) <= '\uFFFF' ) ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null ,input);
recover(mse);
throw mse;
}
buf.appendCodePoint(i);
}
break ;
default :
break loop7;
}
}
match('}' );
setText(buf.toString());
}
break ;
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
public final void mSINGLE_WORD () throws RecognitionException {
try {
int _type = SINGLE_WORD;
int _channel = DEFAULT_TOKEN_CHANNEL;
{
if ( input.LA(1 )=='#' ||(input.LA(1 ) >= '*' && input.LA(1 ) <= ',' )||(input.LA(1 ) >= '.' && input.LA(1 ) <= '9' )||(input.LA(1 ) >= '<' && input.LA(1 ) <= '>' )||(input.LA(1 ) >= '@' && input.LA(1 ) <= 'Z' )||input.LA(1 )=='\\' ||(input.LA(1 ) >= '^' && input.LA(1 ) <= 'z' )||input.LA(1 )=='|' ||(input.LA(1 ) >= '~' && input.LA(1 ) <= '\uFFFF' ) ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null ,input);
recover(mse);
throw mse;
}
loop9:
while (true ) {
int alt9=2 ;
int LA9_0 = input.LA(1 );
if ( (LA9_0=='#' ||(LA9_0 >= '*' && LA9_0 <= '9' )||(LA9_0 >= '<' && LA9_0 <= '>' )||(LA9_0 >= '@' && LA9_0 <= 'Z' )||LA9_0=='\\' ||(LA9_0 >= '^' && LA9_0 <= 'z' )||LA9_0=='|' ||(LA9_0 >= '~' && LA9_0 <= '\uFFFF' )) ) {
alt9=1 ;
}
switch (alt9) {
case 1 :
{
if ( input.LA(1 )=='#' ||(input.LA(1 ) >= '*' && input.LA(1 ) <= '9' )||(input.LA(1 ) >= '<' && input.LA(1 ) <= '>' )||(input.LA(1 ) >= '@' && input.LA(1 ) <= 'Z' )||input.LA(1 )=='\\' ||(input.LA(1 ) >= '^' && input.LA(1 ) <= 'z' )||input.LA(1 )=='|' ||(input.LA(1 ) >= '~' && input.LA(1 ) <= '\uFFFF' ) ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null ,input);
recover(mse);
throw mse;
}
}
break ;
default :
break loop9;
}
}
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
public final void mNON_WORD () throws RecognitionException {
try {
{
if ( (input.LA(1 ) >= '\u0000' && input.LA(1 ) <= '\"' )||(input.LA(1 ) >= '$' && input.LA(1 ) <= ')' )||(input.LA(1 ) >= ':' && input.LA(1 ) <= ';' )||input.LA(1 )=='?' ||input.LA(1 )=='[' ||input.LA(1 )==']' ||input.LA(1 )=='{' ||input.LA(1 )=='}' ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null ,input);
recover(mse);
throw mse;
}
}
}
finally {
}
}
public final void mESCAPE (StringBuilder buf) throws RecognitionException {
try {
int i;
{
match('\\' );
int alt10=4 ;
int LA10_0 = input.LA(1 );
if ( (LA10_0=='t' ) ) {
alt10=1 ;
}
else if ( (LA10_0=='n' ) ) {
alt10=2 ;
}
else if ( (LA10_0=='r' ) ) {
alt10=3 ;
}
else if ( ((LA10_0 >= '\u0000' && LA10_0 <= 'm' )||(LA10_0 >= 'o' && LA10_0 <= 'q' )||LA10_0=='s' ||(LA10_0 >= 'u' && LA10_0 <= '\uFFFF' )) ) {
alt10=4 ;
}
else {
NoViableAltException nvae =
new NoViableAltException("" , 10 , 0 , input);
throw nvae;
}
switch (alt10) {
case 1 :
{
match('t' );
buf.append('\t' );
}
break ;
case 2 :
{
match('n' );
buf.append('\n' );
}
break ;
case 3 :
{
match('r' );
buf.append('\r' );
}
break ;
case 4 :
{
i= input.LA(1 );
if ( (input.LA(1 ) >= '\u0000' && input.LA(1 ) <= 'm' )||(input.LA(1 ) >= 'o' && input.LA(1 ) <= 'q' )||input.LA(1 )=='s' ||(input.LA(1 ) >= 'u' && input.LA(1 ) <= '\uFFFF' ) ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null ,input);
recover(mse);
throw mse;
}
buf.appendCodePoint(i);
}
break ;
}
}
}
finally {
}
}
@Override
public void mTokens () throws RecognitionException {
int alt11=11 ;
alt11 = dfa11.predict(input);
switch (alt11) {
case 1 :
{
mT__16();
}
break ;
case 2 :
{
mT__17();
}
break ;
case 3 :
{
mT__18();
}
break ;
case 4 :
{
mAND();
}
break ;
case 5 :
{
mOR();
}
break ;
case 6 :
{
mNOT();
}
break ;
case 7 :
{
mCOLON();
}
break ;
case 8 :
{
mWS();
}
break ;
case 9 :
{
mFIELD_NAME();
}
break ;
case 10 :
{
mEXACT_PHRASE();
}
break ;
case 11 :
{
mSINGLE_WORD();
}
break ;
}
}
protected DFA11 dfa11 = new DFA11(this );
static final String DFA11_eotS =
"\4\uffff\1\16\1\21\1\16\1\21\1\16\1\21\2\uffff\1\21\2\uffff\1\16\1\21" +
"\1\uffff\1\16\1\21\2\33\1\16\1\21\2\36\1\21\1\uffff\2\37\2\uffff" ;
static final String DFA11_eofS =
"\40\uffff" ;
static final String DFA11_minS =
"\1\11\3\uffff\1\116\1\43\1\122\1\43\1\117\1\43\2\uffff\1\43\2\uffff\1" +
"\104\1\43\1\uffff\1\137\3\43\1\124\4\43\1\uffff\2\43\2\uffff" ;
static final String DFA11_maxS =
"\1\uffff\3\uffff\1\116\1\uffff\1\122\1\uffff\1\117\1\uffff\2\uffff\1\uffff" +
"\2\uffff\1\104\1\uffff\1\uffff\1\172\3\uffff\1\124\4\uffff\1\uffff\2\uffff" +
"\2\uffff" ;
static final String DFA11_acceptS =
"\1\uffff\1\1\1\2\1\3\6\uffff\1\7\1\10\1\uffff\1\12\1\13\2\uffff\1\11\11" +
"\uffff\1\5\2\uffff\1\4\1\6" ;
static final String DFA11_specialS =
"\40\uffff}>" ;
static final String[] DFA11_transitionS = {
"\2\13\2\uffff\1\13\22\uffff\1\13\1\uffff\1\15\1\16\4\uffff\1\1\1\2\3" +
"\16\1\3\14\16\1\12\1\uffff\3\16\1\uffff\1\16\1\4\14\16\1\10\1\6\13\16" +
"\1\uffff\1\16\1\uffff\1\16\1\14\1\16\1\5\14\14\1\11\1\7\13\14\1\15\1" +
"\16\1\uffff\uff82\16" ,
"" ,
"" ,
"" ,
"\1\17" ,
"\1\16\6\uffff\3\16\1\22\14\16\2\uffff\3\16\1\uffff\33\16\1\uffff\1\16" +
"\1\uffff\1\16\1\23\1\16\15\23\1\20\14\23\1\uffff\1\16\1\uffff\uff82\16" ,
"\1\24" ,
"\1\16\6\uffff\3\16\1\22\14\16\2\uffff\3\16\1\uffff\33\16\1\uffff\1\16" +
"\1\uffff\1\16\1\23\1\16\21\23\1\25\10\23\1\uffff\1\16\1\uffff\uff82\16" ,
"\1\26" ,
"\1\16\6\uffff\3\16\1\22\14\16\2\uffff\3\16\1\uffff\33\16\1\uffff\1\16" +
"\1\uffff\1\16\1\23\1\16\16\23\1\27\13\23\1\uffff\1\16\1\uffff\uff82\16" ,
"" ,
"" ,
"\1\16\6\uffff\3\16\1\22\14\16\2\uffff\3\16\1\uffff\33\16\1\uffff\1\16" +
"\1\uffff\1\16\1\23\1\16\32\23\1\uffff\1\16\1\uffff\uff82\16" ,
"" ,
"" ,
"\1\30" ,
"\1\16\6\uffff\3\16\1\22\14\16\2\uffff\3\16\1\uffff\33\16\1\uffff\1\16" +
"\1\uffff\1\16\1\23\1\16\3\23\1\31\26\23\1\uffff\1\16\1\uffff\uff82\16" ,
"" ,
"\1\32\1\uffff\32\32" ,
"\1\16\6\uffff\3\16\1\22\14\16\2\uffff\3\16\1\uffff\33\16\1\uffff\1\16" +
"\1\uffff\1\16\1\23\1\16\32\23\1\uffff\1\16\1\uffff\uff82\16" ,
"\1\16\6\uffff\20\16\2\uffff\3\16\1\uffff\33\16\1\uffff\1\16\1\uffff" +
"\35\16\1\uffff\1\16\1\uffff\uff82\16" ,
"\1\16\6\uffff\3\16\1\22\14\16\2\uffff\3\16\1\uffff\33\16\1\uffff\1\16" +
"\1\uffff\1\16\1\23\1\16\32\23\1\uffff\1\16\1\uffff\uff82\16" ,
"\1\34" ,
"\1\16\6\uffff\3\16\1\22\14\16\2\uffff\3\16\1\uffff\33\16\1\uffff\1\16" +
"\1\uffff\1\16\1\23\1\16\23\23\1\35\6\23\1\uffff\1\16\1\uffff\uff82\16" ,
"\1\16\6\uffff\20\16\2\uffff\3\16\1\uffff\33\16\1\uffff\1\16\1\uffff" +
"\35\16\1\uffff\1\16\1\uffff\uff82\16" ,
"\1\16\6\uffff\3\16\1\22\14\16\2\uffff\3\16\1\uffff\33\16\1\uffff\1\16" +
"\1\uffff\1\16\1\23\1\16\32\23\1\uffff\1\16\1\uffff\uff82\16" ,
"\1\16\6\uffff\3\16\1\22\14\16\2\uffff\3\16\1\uffff\33\16\1\uffff\1\16" +
"\1\uffff\1\16\1\32\1\16\32\32\1\uffff\1\16\1\uffff\uff82\16" ,
"" ,
"\1\16\6\uffff\20\16\2\uffff\3\16\1\uffff\33\16\1\uffff\1\16\1\uffff" +
"\35\16\1\uffff\1\16\1\uffff\uff82\16" ,
"\1\16\6\uffff\3\16\1\22\14\16\2\uffff\3\16\1\uffff\33\16\1\uffff\1\16" +
"\1\uffff\1\16\1\23\1\16\32\23\1\uffff\1\16\1\uffff\uff82\16" ,
"" ,
""
};
static final short [] DFA11_eot = DFA.unpackEncodedString(DFA11_eotS);
static final short [] DFA11_eof = DFA.unpackEncodedString(DFA11_eofS);
static final char [] DFA11_min = DFA.unpackEncodedStringToUnsignedChars(DFA11_minS);
static final char [] DFA11_max = DFA.unpackEncodedStringToUnsignedChars(DFA11_maxS);
static final short [] DFA11_accept = DFA.unpackEncodedString(DFA11_acceptS);
static final short [] DFA11_special = DFA.unpackEncodedString(DFA11_specialS);
static final short [][] DFA11_transition;
static {
int numStates = DFA11_transitionS.length;
DFA11_transition = new short [numStates][];
for (int i=0 ; i