Java TokenStream.index方法代码示例(javatokenstream.index典型用法代码示例汇总)

本文整理汇总了Java中org.antlr.runtime.TokenStream.index方法的典型用法代码示例。如果您正苦于以下问题:Java TokenStream.index方法的具体用法?Java TokenStream.index怎么用?Java TokenStream.index使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.antlr.runtime.TokenStream的用法示例。


Java TokenStream.index方法代码示例(javatokenstream.index典型用法代码示例汇总)

在下文中一共展示了TokenStream.index方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: specialStateTransition

import org.antlr.runtime.TokenStream; //导入方法依赖的package包/类
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,代码行数:27,代码来源:InternalJavaJRExpressionParser.java

示例2: specialStateTransition

import org.antlr.runtime.TokenStream; //导入方法依赖的package包/类
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,代码行数:27,代码来源:InternalJavaJRExpressionParser.java

示例3: appendQuerySnippet

import org.antlr.runtime.TokenStream; //导入方法依赖的package包/类
/**
 * Appends a query snippet to the message to help the user to understand the problem.
 *
 * @param parser the parser used to parse the query
 * @param builder the <code>StringBuilder</code> used to build the error message
 */
private void appendQuerySnippet(Parser parser, StringBuilder builder)
{
    TokenStream tokenStream = parser.getTokenStream();
    int index = tokenStream.index();
    int size = tokenStream.size();

    Token from = tokenStream.get(getSnippetFirstTokenIndex(index));
    Token to = tokenStream.get(getSnippetLastTokenIndex(index, size));
    Token offending = tokenStream.get(getOffendingTokenIndex(index, size));

    appendSnippet(builder, from, to, offending);
} 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:19,代码来源:ErrorCollector.java

示例4: specialStateTransition

import org.antlr.runtime.TokenStream; //导入方法依赖的package包/类
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,代码行数:41,代码来源:CFMLParser.java

示例5: specialStateTransition

import org.antlr.runtime.TokenStream; //导入方法依赖的package包/类
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,代码行数:81,代码来源:AddressParser.java

本文标签属性:

示例:示例英语

代码:代码是什么

java:javascript18岁

TokenStream:TokenStream

index:index函数

上一篇:C# Model.ColumnModel类代码示例
下一篇:朝鲜卫星发射时间(为什么朝鲜的火箭没有发射成功?)(朝鲜卫星发射失败的原因)

为您推荐