// $ANTLR 3.4 antlr/UIQuery.g 2012-12-14 14:03:36 package sh.calaba.instrumentationbackend.query.antlr; import org.antlr.runtime.*; import java.util.Stack; import java.util.List; import java.util.ArrayList; @SuppressWarnings({"all", "warnings", "unchecked"}) public class UIQueryLexer extends Lexer { public static final int EOF=-1; public static final int BOOL=4; public static final int ESC_SEQ=5; public static final int FILTER_COLON=6; public static final int HEX_DIGIT=7; public static final int INT=8; public static final int NAME=9; public static final int NIL=10; public static final int OCTAL_ESC=11; public static final int QUALIFIED_NAME=12; public static final int STRING=13; public static final int UNICODE_ESC=14; public static final int WHITE=15; // delegates // delegators public Lexer[] getDelegates() { return new Lexer[] {}; } public UIQueryLexer() {} public UIQueryLexer(CharStream input) { this(input, new RecognizerSharedState()); } public UIQueryLexer(CharStream input, RecognizerSharedState state) { super(input,state); } public String getGrammarFileName() { return "antlr/UIQuery.g"; } // $ANTLR start "QUALIFIED_NAME" public final void mQUALIFIED_NAME() throws RecognitionException { try { int _type = QUALIFIED_NAME; int _channel = DEFAULT_TOKEN_CHANNEL; // antlr/UIQuery.g:25:16: ( NAME ( '.' NAME )+ ) // antlr/UIQuery.g:25:18: NAME ( '.' NAME )+ { mNAME(); // antlr/UIQuery.g:25:23: ( '.' NAME )+ int cnt1=0; loop1: do { int alt1=2; int LA1_0 = input.LA(1); if ( (LA1_0=='.') ) { alt1=1; } switch (alt1) { case 1 : // antlr/UIQuery.g:25:24: '.' NAME { match('.'); mNAME(); } break; default : if ( cnt1 >= 1 ) break loop1; EarlyExitException eee = new EarlyExitException(1, input); throw eee; } cnt1++; } while (true); } state.type = _type; state.channel = _channel; } finally { // do for sure before leaving } } // $ANTLR end "QUALIFIED_NAME" // $ANTLR start "FILTER_COLON" public final void mFILTER_COLON() throws RecognitionException { try { int _type = FILTER_COLON; int _channel = DEFAULT_TOKEN_CHANNEL; // antlr/UIQuery.g:29:15: ( ':' ) // antlr/UIQuery.g:29:17: ':' { match(':'); } state.type = _type; state.channel = _channel; } finally { // do for sure before leaving } } // $ANTLR end "FILTER_COLON" // $ANTLR start "INT" public final void mINT() throws RecognitionException { try { int _type = INT; int _channel = DEFAULT_TOKEN_CHANNEL; // antlr/UIQuery.g:33:5: ( ( '0' .. '9' )+ ) // antlr/UIQuery.g:33:7: ( '0' .. '9' )+ { // antlr/UIQuery.g:33:7: ( '0' .. '9' )+ int cnt2=0; loop2: do { int alt2=2; int LA2_0 = input.LA(1); if ( ((LA2_0 >= '0' && LA2_0 <= '9')) ) { alt2=1; } switch (alt2) { case 1 : // antlr/UIQuery.g: { if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) { input.consume(); } else { MismatchedSetException mse = new MismatchedSetException(null,input); recover(mse); throw mse; } } break; default : if ( cnt2 >= 1 ) break loop2; EarlyExitException eee = new EarlyExitException(2, input); throw eee; } cnt2++; } while (true); } state.type = _type; state.channel = _channel; } finally { // do for sure before leaving } } // $ANTLR end "INT" // $ANTLR start "BOOL" public final void mBOOL() throws RecognitionException { try { int _type = BOOL; int _channel = DEFAULT_TOKEN_CHANNEL; // antlr/UIQuery.g:36:6: ( 'true' | 'false' ) int alt3=2; int LA3_0 = input.LA(1); if ( (LA3_0=='t') ) { alt3=1; } else if ( (LA3_0=='f') ) { alt3=2; } else { NoViableAltException nvae = new NoViableAltException("", 3, 0, input); throw nvae; } switch (alt3) { case 1 : // antlr/UIQuery.g:36:8: 'true' { match("true"); } break; case 2 : // antlr/UIQuery.g:36:17: 'false' { match("false"); } break; } state.type = _type; state.channel = _channel; } finally { // do for sure before leaving } } // $ANTLR end "BOOL" // $ANTLR start "NIL" public final void mNIL() throws RecognitionException { try { int _type = NIL; int _channel = DEFAULT_TOKEN_CHANNEL; // antlr/UIQuery.g:39:5: ( 'nil' | 'null' ) int alt4=2; int LA4_0 = input.LA(1); if ( (LA4_0=='n') ) { int LA4_1 = input.LA(2); if ( (LA4_1=='i') ) { alt4=1; } else if ( (LA4_1=='u') ) { alt4=2; } else { NoViableAltException nvae = new NoViableAltException("", 4, 1, input); throw nvae; } } else { NoViableAltException nvae = new NoViableAltException("", 4, 0, input); throw nvae; } switch (alt4) { case 1 : // antlr/UIQuery.g:39:7: 'nil' { match("nil"); } break; case 2 : // antlr/UIQuery.g:39:15: 'null' { match("null"); } break; } state.type = _type; state.channel = _channel; } finally { // do for sure before leaving } } // $ANTLR end "NIL" // $ANTLR start "NAME" public final void mNAME() throws RecognitionException { try { int _type = NAME; int _channel = DEFAULT_TOKEN_CHANNEL; // antlr/UIQuery.g:42:7: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* ) // antlr/UIQuery.g:42:9: ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* { if ( (input.LA(1) >= 'A' && input.LA(1) <= 'Z')||input.LA(1)=='_'||(input.LA(1) >= 'a' && input.LA(1) <= 'z') ) { input.consume(); } else { MismatchedSetException mse = new MismatchedSetException(null,input); recover(mse); throw mse; } // antlr/UIQuery.g:42:33: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* loop5: do { int alt5=2; int LA5_0 = input.LA(1); if ( ((LA5_0 >= '0' && LA5_0 <= '9')||(LA5_0 >= 'A' && LA5_0 <= 'Z')||LA5_0=='_'||(LA5_0 >= 'a' && LA5_0 <= 'z')) ) { alt5=1; } switch (alt5) { case 1 : // antlr/UIQuery.g: { if ( (input.LA(1) >= '0' && input.LA(1) <= '9')||(input.LA(1) >= 'A' && input.LA(1) <= 'Z')||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 : break loop5; } } while (true); } state.type = _type; state.channel = _channel; } finally { // do for sure before leaving } } // $ANTLR end "NAME" // $ANTLR start "STRING" public final void mSTRING() throws RecognitionException { try { int _type = STRING; int _channel = DEFAULT_TOKEN_CHANNEL; // antlr/UIQuery.g:46:5: ( '\\'' ( ESC_SEQ |~ ( '\\\\' | '\"' ) )* '\\'' ) // antlr/UIQuery.g:46:8: '\\'' ( ESC_SEQ |~ ( '\\\\' | '\"' ) )* '\\'' { match('\''); // antlr/UIQuery.g:46:13: ( ESC_SEQ |~ ( '\\\\' | '\"' ) )* loop6: do { int alt6=3; int LA6_0 = input.LA(1); if ( (LA6_0=='\'') ) { int LA6_1 = input.LA(2); if ( ((LA6_1 >= '\u0000' && LA6_1 <= '!')||(LA6_1 >= '#' && LA6_1 <= '\uFFFF')) ) { alt6=2; } } else if ( (LA6_0=='\\') ) { alt6=1; } else if ( ((LA6_0 >= '\u0000' && LA6_0 <= '!')||(LA6_0 >= '#' && LA6_0 <= '&')||(LA6_0 >= '(' && LA6_0 <= '[')||(LA6_0 >= ']' && LA6_0 <= '\uFFFF')) ) { alt6=2; } switch (alt6) { case 1 : // antlr/UIQuery.g:46:15: ESC_SEQ { mESC_SEQ(); } break; case 2 : // antlr/UIQuery.g:46:25: ~ ( '\\\\' | '\"' ) { 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; } } break; default : break loop6; } } while (true); match('\''); } state.type = _type; state.channel = _channel; } finally { // do for sure before leaving } } // $ANTLR end "STRING" // $ANTLR start "WHITE" public final void mWHITE() throws RecognitionException { try { int _type = WHITE; int _channel = DEFAULT_TOKEN_CHANNEL; // antlr/UIQuery.g:49:9: ( ( ' ' )* ) // antlr/UIQuery.g:49:11: ( ' ' )* { // antlr/UIQuery.g:49:11: ( ' ' )* loop7: do { int alt7=2; int LA7_0 = input.LA(1); if ( (LA7_0==' ') ) { alt7=1; } switch (alt7) { case 1 : // antlr/UIQuery.g:49:11: ' ' { match(' '); } break; default : break loop7; } } while (true); } state.type = _type; state.channel = _channel; } finally { // do for sure before leaving } } // $ANTLR end "WHITE" // $ANTLR start "HEX_DIGIT" public final void mHEX_DIGIT() throws RecognitionException { try { // antlr/UIQuery.g:52:11: ( ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) ) // antlr/UIQuery.g: { 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') ) { input.consume(); } else { MismatchedSetException mse = new MismatchedSetException(null,input); recover(mse); throw mse; } } } finally { // do for sure before leaving } } // $ANTLR end "HEX_DIGIT" // $ANTLR start "ESC_SEQ" public final void mESC_SEQ() throws RecognitionException { try { // antlr/UIQuery.g:56:5: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | UNICODE_ESC | OCTAL_ESC ) int alt8=3; int LA8_0 = input.LA(1); if ( (LA8_0=='\\') ) { switch ( input.LA(2) ) { case '\"': case '\'': case '\\': case 'b': case 'f': case 'n': case 'r': case 't': { alt8=1; } break; case 'u': { alt8=2; } break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': { alt8=3; } break; default: NoViableAltException nvae = new NoViableAltException("", 8, 1, input); throw nvae; } } else { NoViableAltException nvae = new NoViableAltException("", 8, 0, input); throw nvae; } switch (alt8) { case 1 : // antlr/UIQuery.g:56:9: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) { match('\\'); if ( input.LA(1)=='\"'||input.LA(1)=='\''||input.LA(1)=='\\'||input.LA(1)=='b'||input.LA(1)=='f'||input.LA(1)=='n'||input.LA(1)=='r'||input.LA(1)=='t' ) { input.consume(); } else { MismatchedSetException mse = new MismatchedSetException(null,input); recover(mse); throw mse; } } break; case 2 : // antlr/UIQuery.g:57:9: UNICODE_ESC { mUNICODE_ESC(); } break; case 3 : // antlr/UIQuery.g:58:9: OCTAL_ESC { mOCTAL_ESC(); } break; } } finally { // do for sure before leaving } } // $ANTLR end "ESC_SEQ" // $ANTLR start "OCTAL_ESC" public final void mOCTAL_ESC() throws RecognitionException { try { // antlr/UIQuery.g:63:5: ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ) int alt9=3; int LA9_0 = input.LA(1); if ( (LA9_0=='\\') ) { int LA9_1 = input.LA(2); if ( ((LA9_1 >= '0' && LA9_1 <= '3')) ) { int LA9_2 = input.LA(3); if ( ((LA9_2 >= '0' && LA9_2 <= '7')) ) { int LA9_4 = input.LA(4); if ( ((LA9_4 >= '0' && LA9_4 <= '7')) ) { alt9=1; } else { alt9=2; } } else { alt9=3; } } else if ( ((LA9_1 >= '4' && LA9_1 <= '7')) ) { int LA9_3 = input.LA(3); if ( ((LA9_3 >= '0' && LA9_3 <= '7')) ) { alt9=2; } else { alt9=3; } } else { NoViableAltException nvae = new NoViableAltException("", 9, 1, input); throw nvae; } } else { NoViableAltException nvae = new NoViableAltException("", 9, 0, input); throw nvae; } switch (alt9) { case 1 : // antlr/UIQuery.g:63:9: '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) { match('\\'); if ( (input.LA(1) >= '0' && input.LA(1) <= '3') ) { input.consume(); } else { MismatchedSetException mse = new MismatchedSetException(null,input); recover(mse); throw mse; } if ( (input.LA(1) >= '0' && input.LA(1) <= '7') ) { input.consume(); } else { MismatchedSetException mse = new MismatchedSetException(null,input); recover(mse); throw mse; } if ( (input.LA(1) >= '0' && input.LA(1) <= '7') ) { input.consume(); } else { MismatchedSetException mse = new MismatchedSetException(null,input); recover(mse); throw mse; } } break; case 2 : // antlr/UIQuery.g:64:9: '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) { match('\\'); if ( (input.LA(1) >= '0' && input.LA(1) <= '7') ) { input.consume(); } else { MismatchedSetException mse = new MismatchedSetException(null,input); recover(mse); throw mse; } if ( (input.LA(1) >= '0' && input.LA(1) <= '7') ) { input.consume(); } else { MismatchedSetException mse = new MismatchedSetException(null,input); recover(mse); throw mse; } } break; case 3 : // antlr/UIQuery.g:65:9: '\\\\' ( '0' .. '7' ) { match('\\'); if ( (input.LA(1) >= '0' && input.LA(1) <= '7') ) { input.consume(); } else { MismatchedSetException mse = new MismatchedSetException(null,input); recover(mse); throw mse; } } break; } } finally { // do for sure before leaving } } // $ANTLR end "OCTAL_ESC" // $ANTLR start "UNICODE_ESC" public final void mUNICODE_ESC() throws RecognitionException { try { // antlr/UIQuery.g:70:5: ( '\\\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT ) // antlr/UIQuery.g:70:9: '\\\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT { match('\\'); match('u'); mHEX_DIGIT(); mHEX_DIGIT(); mHEX_DIGIT(); mHEX_DIGIT(); } } finally { // do for sure before leaving } } // $ANTLR end "UNICODE_ESC" public void mTokens() throws RecognitionException { // antlr/UIQuery.g:1:8: ( QUALIFIED_NAME | FILTER_COLON | INT | BOOL | NIL | NAME | STRING | WHITE ) int alt10=8; alt10 = dfa10.predict(input); switch (alt10) { case 1 : // antlr/UIQuery.g:1:10: QUALIFIED_NAME { mQUALIFIED_NAME(); } break; case 2 : // antlr/UIQuery.g:1:25: FILTER_COLON { mFILTER_COLON(); } break; case 3 : // antlr/UIQuery.g:1:38: INT { mINT(); } break; case 4 : // antlr/UIQuery.g:1:42: BOOL { mBOOL(); } break; case 5 : // antlr/UIQuery.g:1:47: NIL { mNIL(); } break; case 6 : // antlr/UIQuery.g:1:51: NAME { mNAME(); } break; case 7 : // antlr/UIQuery.g:1:56: STRING { mSTRING(); } break; case 8 : // antlr/UIQuery.g:1:63: WHITE { mWHITE(); } break; } } protected DFA10 dfa10 = new DFA10(this); static final String DFA10_eotS = "\1\10\1\13\2\uffff\3\13\2\uffff\2\13\2\uffff\5\13\1\26\1\13\1\30"+ "\1\13\1\uffff\1\26\1\uffff\1\30"; static final String DFA10_eofS = "\32\uffff"; static final String DFA10_minS = "\1\47\1\56\2\uffff\3\56\2\uffff\2\56\2\uffff\11\56\1\uffff\1\56"+ "\1\uffff\1\56"; static final String DFA10_maxS = "\2\172\2\uffff\3\172\2\uffff\2\172\2\uffff\11\172\1\uffff\1\172"+ "\1\uffff\1\172"; static final String DFA10_acceptS = "\2\uffff\1\2\1\3\3\uffff\1\7\1\10\2\uffff\1\6\1\1\11\uffff\1\5\1"+ "\uffff\1\4\1\uffff"; static final String DFA10_specialS = "\32\uffff}>"; static final String[] DFA10_transitionS = { "\1\7\10\uffff\12\3\1\2\6\uffff\32\6\4\uffff\1\6\1\uffff\5\6"+ "\1\4\7\6\1\5\5\6\1\1\6\6", "\1\14\1\uffff\12\12\7\uffff\32\12\4\uffff\1\12\1\uffff\21\12"+ "\1\11\10\12", "", "", "\1\14\1\uffff\12\12\7\uffff\32\12\4\uffff\1\12\1\uffff\1\15"+ "\31\12", "\1\14\1\uffff\12\12\7\uffff\32\12\4\uffff\1\12\1\uffff\10\12"+ "\1\16\13\12\1\17\5\12", "\1\14\1\uffff\12\12\7\uffff\32\12\4\uffff\1\12\1\uffff\32\12", "", "", "\1\14\1\uffff\12\12\7\uffff\32\12\4\uffff\1\12\1\uffff\24\12"+ "\1\20\5\12", "\1\14\1\uffff\12\12\7\uffff\32\12\4\uffff\1\12\1\uffff\32\12", "", "", "\1\14\1\uffff\12\12\7\uffff\32\12\4\uffff\1\12\1\uffff\13\12"+ "\1\21\16\12", "\1\14\1\uffff\12\12\7\uffff\32\12\4\uffff\1\12\1\uffff\13\12"+ "\1\22\16\12", "\1\14\1\uffff\12\12\7\uffff\32\12\4\uffff\1\12\1\uffff\13\12"+ "\1\23\16\12", "\1\14\1\uffff\12\12\7\uffff\32\12\4\uffff\1\12\1\uffff\4\12"+ "\1\24\25\12", "\1\14\1\uffff\12\12\7\uffff\32\12\4\uffff\1\12\1\uffff\22\12"+ "\1\25\7\12", "\1\14\1\uffff\12\12\7\uffff\32\12\4\uffff\1\12\1\uffff\32\12", "\1\14\1\uffff\12\12\7\uffff\32\12\4\uffff\1\12\1\uffff\13\12"+ "\1\27\16\12", "\1\14\1\uffff\12\12\7\uffff\32\12\4\uffff\1\12\1\uffff\32\12", "\1\14\1\uffff\12\12\7\uffff\32\12\4\uffff\1\12\1\uffff\4\12"+ "\1\31\25\12", "", "\1\14\1\uffff\12\12\7\uffff\32\12\4\uffff\1\12\1\uffff\32\12", "", "\1\14\1\uffff\12\12\7\uffff\32\12\4\uffff\1\12\1\uffff\32\12" }; static final short[] DFA10_eot = DFA.unpackEncodedString(DFA10_eotS); static final short[] DFA10_eof = DFA.unpackEncodedString(DFA10_eofS); static final char[] DFA10_min = DFA.unpackEncodedStringToUnsignedChars(DFA10_minS); static final char[] DFA10_max = DFA.unpackEncodedStringToUnsignedChars(DFA10_maxS); static final short[] DFA10_accept = DFA.unpackEncodedString(DFA10_acceptS); static final short[] DFA10_special = DFA.unpackEncodedString(DFA10_specialS); static final short[][] DFA10_transition; static { int numStates = DFA10_transitionS.length; DFA10_transition = new short[numStates][]; for (int i=0; i