3 package com
.google
.appengine
.api
.search
.query
;
5 import org
.antlr
.runtime
.*;
7 public class QueryLexer
extends Lexer
{
8 public static final int FUNCTION
=8;
9 public static final int FIX
=30;
10 public static final int ESC
=36;
11 public static final int OCTAL_ESC
=35;
12 public static final int FUZZY
=9;
13 public static final int NOT
=28;
14 public static final int AND
=26;
15 public static final int ESCAPED_CHAR
=44;
16 public static final int EOF
=-1;
17 public static final int LPAREN
=24;
18 public static final int HAS
=23;
19 public static final int QUOTE
=33;
20 public static final int RPAREN
=25;
21 public static final int START_CHAR
=39;
22 public static final int COMMA
=29;
23 public static final int ARGS
=4;
24 public static final int DIGIT
=43;
25 public static final int EQ
=22;
26 public static final int NE
=21;
27 public static final int LESSTHAN
=18;
28 public static final int GE
=19;
29 public static final int TEXT_ESC
=41;
30 public static final int CONJUNCTION
=5;
31 public static final int UNICODE_ESC
=34;
32 public static final int HEX_DIGIT
=45;
33 public static final int LITERAL
=11;
34 public static final int VALUE
=15;
35 public static final int TEXT
=32;
36 public static final int MINUS
=38;
37 public static final int NUMBER_PREFIX
=40;
38 public static final int REWRITE
=31;
39 public static final int EMPTY
=7;
40 public static final int SEQUENCE
=14;
41 public static final int DISJUNCTION
=6;
42 public static final int WS
=16;
43 public static final int NEGATION
=12;
44 public static final int OR
=27;
45 public static final int GT
=20;
46 public static final int GLOBAL
=10;
47 public static final int LE
=17;
48 public static final int MID_CHAR
=42;
49 public static final int STRING
=13;
50 public static final int BACKSLASH
=37;
52 public QueryLexer() {;}
53 public QueryLexer(CharStream input
) {
54 this(input
, new RecognizerSharedState());
56 public QueryLexer(CharStream input
, RecognizerSharedState state
) {
60 public String
getGrammarFileName() { return ""; }
62 public final void mHAS() throws RecognitionException
{
65 int _channel
= DEFAULT_TOKEN_CHANNEL
;
72 state
.channel
= _channel
;
78 public final void mOR() throws RecognitionException
{
81 int _channel
= DEFAULT_TOKEN_CHANNEL
;
88 state
.channel
= _channel
;
94 public final void mAND() throws RecognitionException
{
97 int _channel
= DEFAULT_TOKEN_CHANNEL
;
104 state
.channel
= _channel
;
110 public final void mNOT() throws RecognitionException
{
113 int _channel
= DEFAULT_TOKEN_CHANNEL
;
120 state
.channel
= _channel
;
126 public final void mREWRITE() throws RecognitionException
{
129 int _channel
= DEFAULT_TOKEN_CHANNEL
;
136 state
.channel
= _channel
;
142 public final void mFIX() throws RecognitionException
{
145 int _channel
= DEFAULT_TOKEN_CHANNEL
;
152 state
.channel
= _channel
;
158 public final void mESC() throws RecognitionException
{
161 int _channel
= DEFAULT_TOKEN_CHANNEL
;
163 int LA1_0
= input
.LA(1);
165 if ( (LA1_0
=='\\') ) {
166 switch ( input
.LA(2) ) {
191 NoViableAltException nvae
=
192 new NoViableAltException("", 1, 1, input
);
199 NoViableAltException nvae
=
200 new NoViableAltException("", 1, 0, input
);
208 if ( input
.LA(1)=='\"'||input
.LA(1)=='\\' ) {
213 MismatchedSetException mse
= new MismatchedSetException(null,input
);
234 state
.channel
= _channel
;
240 public final void mWS() throws RecognitionException
{
243 int _channel
= DEFAULT_TOKEN_CHANNEL
;
245 if ( (input
.LA(1)>='\t' && input
.LA(1)<='\n')||(input
.LA(1)>='\f' && input
.LA(1)<='\r')||input
.LA(1)==' ' ) {
250 MismatchedSetException mse
= new MismatchedSetException(null,input
);
257 state
.channel
= _channel
;
263 public final void mLPAREN() throws RecognitionException
{
266 int _channel
= DEFAULT_TOKEN_CHANNEL
;
273 state
.channel
= _channel
;
279 public final void mRPAREN() throws RecognitionException
{
282 int _channel
= DEFAULT_TOKEN_CHANNEL
;
289 state
.channel
= _channel
;
295 public final void mCOMMA() throws RecognitionException
{
298 int _channel
= DEFAULT_TOKEN_CHANNEL
;
305 state
.channel
= _channel
;
311 public final void mBACKSLASH() throws RecognitionException
{
313 int _type
= BACKSLASH
;
314 int _channel
= DEFAULT_TOKEN_CHANNEL
;
321 state
.channel
= _channel
;
327 public final void mLESSTHAN() throws RecognitionException
{
329 int _type
= LESSTHAN
;
330 int _channel
= DEFAULT_TOKEN_CHANNEL
;
337 state
.channel
= _channel
;
343 public final void mGT() throws RecognitionException
{
346 int _channel
= DEFAULT_TOKEN_CHANNEL
;
353 state
.channel
= _channel
;
359 public final void mGE() throws RecognitionException
{
362 int _channel
= DEFAULT_TOKEN_CHANNEL
;
369 state
.channel
= _channel
;
375 public final void mLE() throws RecognitionException
{
378 int _channel
= DEFAULT_TOKEN_CHANNEL
;
385 state
.channel
= _channel
;
391 public final void mNE() throws RecognitionException
{
394 int _channel
= DEFAULT_TOKEN_CHANNEL
;
401 state
.channel
= _channel
;
407 public final void mEQ() throws RecognitionException
{
410 int _channel
= DEFAULT_TOKEN_CHANNEL
;
417 state
.channel
= _channel
;
423 public final void mMINUS() throws RecognitionException
{
426 int _channel
= DEFAULT_TOKEN_CHANNEL
;
433 state
.channel
= _channel
;
439 public final void mQUOTE() throws RecognitionException
{
442 int _channel
= DEFAULT_TOKEN_CHANNEL
;
449 state
.channel
= _channel
;
455 public final void mTEXT() throws RecognitionException
{
458 int _channel
= DEFAULT_TOKEN_CHANNEL
;
461 int LA2_0
= input
.LA(1);
463 if ( (LA2_0
=='!'||(LA2_0
>='#' && LA2_0
<='\'')||LA2_0
=='*'||(LA2_0
>='.' && LA2_0
<='/')||LA2_0
==';'||(LA2_0
>='?' && LA2_0
<='[')||(LA2_0
>=']' && LA2_0
<='}')||(LA2_0
>='\u00A1' && LA2_0
<='\uFFEE')) ) {
466 else if ( (LA2_0
=='-'||(LA2_0
>='0' && LA2_0
<='9')) ) {
469 else if ( (LA2_0
=='\\') ) {
473 NoViableAltException nvae
=
474 new NoViableAltException("", 2, 0, input
);
503 int LA3_0
= input
.LA(1);
505 if ( (LA3_0
=='!'||(LA3_0
>='#' && LA3_0
<='\'')||(LA3_0
>='*' && LA3_0
<='+')||(LA3_0
>='-' && LA3_0
<='9')||LA3_0
==';'||(LA3_0
>='?' && LA3_0
<='[')||(LA3_0
>=']' && LA3_0
<='}')||(LA3_0
>='\u00A1' && LA3_0
<='\uFFEE')) ) {
508 else if ( (LA3_0
=='\\') ) {
534 state
.channel
= _channel
;
540 public final void mNUMBER_PREFIX() throws RecognitionException
{
544 int LA4_0
= input
.LA(1);
546 if ( (LA4_0
=='-') ) {
568 public final void mTEXT_ESC() throws RecognitionException
{
571 int LA5_0
= input
.LA(1);
573 if ( (LA5_0
=='\\') ) {
574 switch ( input
.LA(2) ) {
606 NoViableAltException nvae
=
607 new NoViableAltException("", 5, 1, input
);
614 NoViableAltException nvae
=
615 new NoViableAltException("", 5, 0, input
);
645 public final void mUNICODE_ESC() throws RecognitionException
{
662 public final void mOCTAL_ESC() throws RecognitionException
{
665 int LA6_0
= input
.LA(1);
667 if ( (LA6_0
=='\\') ) {
668 int LA6_1
= input
.LA(2);
670 if ( ((LA6_1
>='0' && LA6_1
<='3')) ) {
671 int LA6_2
= input
.LA(3);
673 if ( ((LA6_2
>='0' && LA6_2
<='7')) ) {
674 int LA6_4
= input
.LA(4);
676 if ( ((LA6_4
>='0' && LA6_4
<='7')) ) {
685 else if ( ((LA6_1
>='4' && LA6_1
<='7')) ) {
686 int LA6_3
= input
.LA(3);
688 if ( ((LA6_3
>='0' && LA6_3
<='7')) ) {
695 NoViableAltException nvae
=
696 new NoViableAltException("", 6, 1, input
);
702 NoViableAltException nvae
=
703 new NoViableAltException("", 6, 0, input
);
760 public final void mDIGIT() throws RecognitionException
{
772 public final void mHEX_DIGIT() throws RecognitionException
{
775 if ( (input
.LA(1)>='0' && input
.LA(1)<='9')||(input
.LA(1)>='A' && input
.LA(1)<='F')||(input
.LA(1)>='a' && input
.LA(1)<='f') ) {
780 MismatchedSetException mse
= new MismatchedSetException(null,input
);
791 public final void mSTART_CHAR() throws RecognitionException
{
794 if ( 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
.LA(1)<='}')||(input
.LA(1)>='\u00A1' && input
.LA(1)<='\uFFEE') ) {
799 MismatchedSetException mse
= new MismatchedSetException(null,input
);
810 public final void mMID_CHAR() throws RecognitionException
{
813 if ( input
.LA(1)=='!'||(input
.LA(1)>='#' && 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)>=']' && input
.LA(1)<='}')||(input
.LA(1)>='\u00A1' && input
.LA(1)<='\uFFEE') ) {
818 MismatchedSetException mse
= new MismatchedSetException(null,input
);
829 public final void mESCAPED_CHAR() throws RecognitionException
{
832 alt7
= dfa7
.predict(input
);
895 public void mTokens() throws RecognitionException
{
897 alt8
= dfa8
.predict(input
);
1030 protected DFA7 dfa7
= new DFA7(this);
1031 protected DFA8 dfa8
= new DFA8(this);
1032 static final String DFA7_eotS
=
1034 static final String DFA7_eofS
=
1036 static final String DFA7_minS
=
1037 "\1\134\1\42\11\uffff";
1038 static final String DFA7_maxS
=
1039 "\1\134\1\176\11\uffff";
1040 static final String DFA7_acceptS
=
1041 "\2\uffff\1\1\1\2\1\3\1\4\1\5\1\6\1\7\1\10\1\11";
1042 static final String DFA7_specialS
=
1044 static final String
[] DFA7_transitionS
= {
1046 "\1\11\10\uffff\1\7\1\2\15\uffff\1\3\1\uffff\1\5\1\4\1\6\35"+
1047 "\uffff\1\12\41\uffff\1\10",
1059 static final short[] DFA7_eot
= DFA
.unpackEncodedString(DFA7_eotS
);
1060 static final short[] DFA7_eof
= DFA
.unpackEncodedString(DFA7_eofS
);
1061 static final char[] DFA7_min
= DFA
.unpackEncodedStringToUnsignedChars(DFA7_minS
);
1062 static final char[] DFA7_max
= DFA
.unpackEncodedStringToUnsignedChars(DFA7_maxS
);
1063 static final short[] DFA7_accept
= DFA
.unpackEncodedString(DFA7_acceptS
);
1064 static final short[] DFA7_special
= DFA
.unpackEncodedString(DFA7_specialS
);
1065 static final short[][] DFA7_transition
;
1068 int numStates
= DFA7_transitionS
.length
;
1069 DFA7_transition
= new short[numStates
][];
1070 for (int i
=0; i
<numStates
; i
++) {
1071 DFA7_transition
[i
] = DFA
.unpackEncodedString(DFA7_transitionS
[i
]);
1075 class DFA7
extends DFA
{
1077 public DFA7(BaseRecognizer recognizer
) {
1078 this.recognizer
= recognizer
;
1079 this.decisionNumber
= 7;
1080 this.eot
= DFA7_eot
;
1081 this.eof
= DFA7_eof
;
1082 this.min
= DFA7_min
;
1083 this.max
= DFA7_max
;
1084 this.accept
= DFA7_accept
;
1085 this.special
= DFA7_special
;
1086 this.transition
= DFA7_transition
;
1088 public String
getDescription() {
1089 return "348:10: fragment ESCAPED_CHAR : ( '\\\\,' | '\\\\:' | '\\\\=' | '\\\\<' | '\\\\>' | '\\\\+' | '\\\\~' | '\\\\\\\"' | '\\\\\\\\' );";
1092 static final String DFA8_eotS
=
1093 "\2\uffff\3\22\2\uffff\1\33\4\uffff\1\35\1\37\1\22\1\uffff\1\41\2"+
1094 "\uffff\1\42\2\22\1\45\1\uffff\3\45\10\uffff\1\51\1\52\2\uffff\2"+
1095 "\45\3\uffff\1\45\1\uffff\1\45";
1096 static final String DFA8_eofS
=
1098 static final String DFA8_minS
=
1099 "\1\11\1\uffff\1\122\1\116\1\117\2\uffff\1\42\4\uffff\3\75\1\uffff"+
1100 "\1\60\2\uffff\1\41\1\104\1\124\1\41\1\60\3\41\10\uffff\2\41\1\uffff"+
1101 "\1\60\2\41\2\uffff\1\60\1\41\1\60\1\41";
1102 static final String DFA8_maxS
=
1103 "\1\uffee\1\uffff\1\122\1\116\1\117\2\uffff\1\176\4\uffff\3\75\1"+
1104 "\uffff\1\71\2\uffff\1\uffee\1\104\1\124\1\uffee\1\146\3\uffee\10"+
1105 "\uffff\2\uffee\1\uffff\1\146\2\uffee\2\uffff\1\146\1\uffee\1\146"+
1107 static final String DFA8_acceptS
=
1108 "\1\uffff\1\1\3\uffff\1\5\1\6\1\uffff\1\10\1\11\1\12\1\13\3\uffff"+
1109 "\1\22\1\uffff\1\24\1\25\10\uffff\1\14\1\20\1\15\1\17\1\16\1\21\1"+
1110 "\23\1\2\2\uffff\1\7\3\uffff\1\3\1\4\4\uffff";
1111 static final String DFA8_specialS
=
1113 static final String
[] DFA8_transitionS
= {
1114 "\2\10\1\uffff\2\10\22\uffff\1\10\1\16\1\21\5\22\1\11\1\12\1"+
1115 "\22\1\6\1\13\1\20\14\22\1\1\1\22\1\14\1\17\1\15\2\22\1\3\14"+
1116 "\22\1\4\1\2\14\22\1\7\41\22\1\5\42\uffff\uff4e\22",
1123 "\1\26\10\uffff\2\22\3\uffff\4\31\4\32\2\uffff\1\22\1\uffff"+
1124 "\3\22\35\uffff\1\30\30\uffff\1\27\10\uffff\1\22",
1136 "\1\22\1\uffff\5\22\2\uffff\2\22\1\uffff\15\22\1\uffff\1\22"+
1137 "\3\uffff\77\22\43\uffff\uff4e\22",
1140 "\1\22\1\uffff\5\22\2\uffff\2\22\1\uffff\15\22\1\uffff\1\22"+
1141 "\3\uffff\77\22\43\uffff\uff4e\22",
1142 "\12\46\7\uffff\6\46\32\uffff\6\46",
1143 "\1\22\1\uffff\5\22\2\uffff\2\22\1\uffff\15\22\1\uffff\1\22"+
1144 "\3\uffff\77\22\43\uffff\uff4e\22",
1145 "\1\22\1\uffff\5\22\2\uffff\2\22\1\uffff\3\22\10\47\2\22\1\uffff"+
1146 "\1\22\3\uffff\77\22\43\uffff\uff4e\22",
1147 "\1\22\1\uffff\5\22\2\uffff\2\22\1\uffff\3\22\10\50\2\22\1\uffff"+
1148 "\1\22\3\uffff\77\22\43\uffff\uff4e\22",
1157 "\1\22\1\uffff\5\22\2\uffff\2\22\1\uffff\15\22\1\uffff\1\22"+
1158 "\3\uffff\77\22\43\uffff\uff4e\22",
1159 "\1\22\1\uffff\5\22\2\uffff\2\22\1\uffff\15\22\1\uffff\1\22"+
1160 "\3\uffff\77\22\43\uffff\uff4e\22",
1162 "\12\53\7\uffff\6\53\32\uffff\6\53",
1163 "\1\22\1\uffff\5\22\2\uffff\2\22\1\uffff\3\22\10\54\2\22\1\uffff"+
1164 "\1\22\3\uffff\77\22\43\uffff\uff4e\22",
1165 "\1\22\1\uffff\5\22\2\uffff\2\22\1\uffff\15\22\1\uffff\1\22"+
1166 "\3\uffff\77\22\43\uffff\uff4e\22",
1169 "\12\55\7\uffff\6\55\32\uffff\6\55",
1170 "\1\22\1\uffff\5\22\2\uffff\2\22\1\uffff\15\22\1\uffff\1\22"+
1171 "\3\uffff\77\22\43\uffff\uff4e\22",
1172 "\12\56\7\uffff\6\56\32\uffff\6\56",
1173 "\1\22\1\uffff\5\22\2\uffff\2\22\1\uffff\15\22\1\uffff\1\22"+
1174 "\3\uffff\77\22\43\uffff\uff4e\22"
1177 static final short[] DFA8_eot
= DFA
.unpackEncodedString(DFA8_eotS
);
1178 static final short[] DFA8_eof
= DFA
.unpackEncodedString(DFA8_eofS
);
1179 static final char[] DFA8_min
= DFA
.unpackEncodedStringToUnsignedChars(DFA8_minS
);
1180 static final char[] DFA8_max
= DFA
.unpackEncodedStringToUnsignedChars(DFA8_maxS
);
1181 static final short[] DFA8_accept
= DFA
.unpackEncodedString(DFA8_acceptS
);
1182 static final short[] DFA8_special
= DFA
.unpackEncodedString(DFA8_specialS
);
1183 static final short[][] DFA8_transition
;
1186 int numStates
= DFA8_transitionS
.length
;
1187 DFA8_transition
= new short[numStates
][];
1188 for (int i
=0; i
<numStates
; i
++) {
1189 DFA8_transition
[i
] = DFA
.unpackEncodedString(DFA8_transitionS
[i
]);
1193 class DFA8
extends DFA
{
1195 public DFA8(BaseRecognizer recognizer
) {
1196 this.recognizer
= recognizer
;
1197 this.decisionNumber
= 8;
1198 this.eot
= DFA8_eot
;
1199 this.eof
= DFA8_eof
;
1200 this.min
= DFA8_min
;
1201 this.max
= DFA8_max
;
1202 this.accept
= DFA8_accept
;
1203 this.special
= DFA8_special
;
1204 this.transition
= DFA8_transition
;
1206 public String
getDescription() {
1207 return "1:1: Tokens : ( HAS | OR | AND | NOT | REWRITE | FIX | ESC | WS | LPAREN | RPAREN | COMMA | BACKSLASH | LESSTHAN | GT | GE | LE | NE | EQ | MINUS | QUOTE | TEXT );";