當前位置: 首頁>>代碼示例>>Java>>正文


Java TokenStream.LA屬性代碼示例

本文整理匯總了Java中org.antlr.runtime.TokenStream.LA屬性的典型用法代碼示例。如果您正苦於以下問題:Java TokenStream.LA屬性的具體用法?Java TokenStream.LA怎麽用?Java TokenStream.LA使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.antlr.runtime.TokenStream的用法示例。


在下文中一共展示了TokenStream.LA屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: specialStateTransition

public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
    TokenStream input = (TokenStream)_input;
	int _s = s;
    switch ( s ) {
            case 0 : 
                int LA14_3 = input.LA(1);

                 
                int index14_3 = input.index();
                input.rewind();
                s = -1;
                if ( (synpred9_InternalJavaJRExpression()) ) {s = 19;}

                else if ( (true) ) {s = 4;}

                 
                input.seek(index14_3);
                if ( s>=0 ) return s;
                break;
    }
    if (state.backtracking>0) {state.failed=true; return -1;}
    NoViableAltException nvae =
        new NoViableAltException(getDescription(), 14, _s, input);
    error(nvae);
    throw nvae;
}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:26,代碼來源:InternalJavaJRExpressionParser.java

示例2: specialStateTransition

public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
    TokenStream input = (TokenStream)_input;
	int _s = s;
    switch ( s ) {
            case 0 : 
                int LA6_3 = input.LA(1);

                 
                int index6_3 = input.index();
                input.rewind();
                s = -1;
                if ( (synpred10_InternalJavaJRExpression()) ) {s = 19;}

                else if ( (true) ) {s = 4;}

                 
                input.seek(index6_3);
                if ( s>=0 ) return s;
                break;
    }
    if (state.backtracking>0) {state.failed=true; return -1;}
    NoViableAltException nvae =
        new NoViableAltException(getDescription(), 6, _s, input);
    error(nvae);
    throw nvae;
}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:26,代碼來源:InternalJavaJRExpressionParser.java

示例3: specialStateTransition

public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
    TokenStream input = (TokenStream)_input;
	int _s = s;
    switch ( s ) {
            case 0 : 
                int LA57_0 = input.LA(1);

                 
                int index57_0 = input.index();
                input.rewind();
                s = -1;
                if ( (LA57_0==EOF||LA57_0==BOOLEAN_LITERAL||LA57_0==STRING_LITERAL||LA57_0==NULL||LA57_0==CONTAIN||LA57_0==THAN||(LA57_0>=OR && LA57_0<=AND)||(LA57_0>=VAR && LA57_0<=FOR)||(LA57_0>=TRY && LA57_0<=SCRIPTCLOSE)||(LA57_0>=PLUS && LA57_0<=MINUSMINUS)||LA57_0==NOTOP||(LA57_0>=SEMICOLON && LA57_0<=LEFTBRACKET)||(LA57_0>=LEFTPAREN && LA57_0<=IDENTIFIER)||LA57_0==INTEGER_LITERAL||(LA57_0>=FLOATING_POINT_LITERAL && LA57_0<=138)||LA57_0==144) ) {s = 1;}

                else if ( (LA57_0==DOES) ) {s = 2;}

                else if ( (LA57_0==GREATER) ) {s = 3;}

                else if ( (LA57_0==LESS) ) {s = 4;}

                else if ( (LA57_0==NOT) ) {s = 5;}

                else if ( (LA57_0==IN) && ((!scriptMode))) {s = 6;}

                else if ( ((LA57_0>=EQUALSOP && LA57_0<=COLON)||LA57_0==QUESTIONMARK||LA57_0==RIGHTBRACKET) ) {s = 7;}

                else if ( (LA57_0==LT) ) {s = 8;}

                else if ( (LA57_0==CONTAINS||(LA57_0>=IS && LA57_0<=LTE)||(LA57_0>=LE && LA57_0<=NEQ)||LA57_0==EQUALSEQUALSOP||(LA57_0>=139 && LA57_0<=143)) ) {s = 9;}

                 
                input.seek(index57_0);
                if ( s>=0 ) return s;
                break;
    }
    if (state.backtracking>0) {state.failed=true; return -1;}
    NoViableAltException nvae =
        new NoViableAltException(getDescription(), 57, _s, input);
    error(nvae);
    throw nvae;
}
 
開發者ID:OpenBD,項目名稱:openbd-core,代碼行數:40,代碼來源:CFMLParser.java

示例4: specialStateTransition

public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
    TokenStream input = (TokenStream)_input;
	int _s = s;
    switch ( s ) {
            case 0 : 
                int LA8_2 = input.LA(1);

                 
                int index8_2 = input.index();
                input.rewind();
                s = -1;
                if ( (((!address.isStreetTypePrefix() || ("C".equals(address.getStreetType()) && address.getStreetNumberSuffix() == null)) && addressDatabase.containsStreetType(input.LT(1).getText()))) ) {s = 7;}

                else if ( ((hasStreetNameStarted && Address.isStreetDirection(input.LT(1).getText()))) ) {s = 8;}

                else if ( (((!hasStreetNameStarted) && address.getStreetType() == null)) ) {s = 10;}

                else if ( (true) ) {s = 5;}

                 
                input.seek(index8_2);
                if ( s>=0 ) return s;
                break;
            case 1 : 
                int LA8_3 = input.LA(1);

                 
                int index8_3 = input.index();
                input.rewind();
                s = -1;
                if ( (((!hasStreetNameStarted) && address.getStreetType() == null)) ) {s = 10;}

                else if ( (true) ) {s = 5;}

                 
                input.seek(index8_3);
                if ( s>=0 ) return s;
                break;
            case 2 : 
                int LA8_4 = input.LA(1);

                 
                int index8_4 = input.index();
                input.rewind();
                s = -1;
                if ( ((hasStreetNameStarted)) ) {s = 11;}

                else if ( (true) ) {s = 5;}

                 
                input.seek(index8_4);
                if ( s>=0 ) return s;
                break;
            case 3 : 
                int LA8_1 = input.LA(1);

                 
                int index8_1 = input.index();
                input.rewind();
                s = -1;
                if ( (LA8_1==NUMBER) && ((Address.isSuiteType(input.LT(1).getText())))) {s = 6;}

                else if ( (((!address.isStreetTypePrefix() || ("C".equals(address.getStreetType()) && address.getStreetNumberSuffix() == null)) && addressDatabase.containsStreetType(input.LT(1).getText()))) ) {s = 7;}

                else if ( ((hasStreetNameStarted && Address.isStreetDirection(input.LT(1).getText()))) ) {s = 8;}

                else if ( ((((hasStreetNameStarted && startsUrbanNotRural)&&(Address.isRuralRoute(input.LT(1).getText() + " " + input.LT(2).getText() + " " + input.LT(3).getText())))||((hasStreetNameStarted && startsUrbanNotRural)&&(Address.isRuralRoute(input.LT(1).getText() + " " + input.LT(2).getText())))||((hasStreetNameStarted && startsUrbanNotRural)&&(Address.isRuralRoute(input.LT(1).getText()))))) ) {s = 9;}

                else if ( (true) ) {s = 5;}

                 
                input.seek(index8_1);
                if ( s>=0 ) return s;
                break;
    }
    NoViableAltException nvae =
        new NoViableAltException(getDescription(), 8, _s, input);
    error(nvae);
    throw nvae;
}
 
開發者ID:SQLPower,項目名稱:power-matchmaker,代碼行數:80,代碼來源:AddressParser.java


注:本文中的org.antlr.runtime.TokenStream.LA屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。