Example usage for org.antlr.v4.runtime TokenStream index

List of usage examples for org.antlr.v4.runtime TokenStream index

Introduction

In this page you can find the example usage for org.antlr.v4.runtime TokenStream index.

Prototype

int index();

Source Link

Document

Return the index into the stream of the input symbol referred to by LA(1) .

Usage

From source file:org.tvl.goworks.editor.go.semantics.TreeCorrectionParserATNSimulator.java

License:Open Source License

@Override
public int adaptivePredict(TokenStream input, int decision, ParserRuleContext outerContext) {
    boolean ll1opt = optimize_ll1;
    try {/*from   w w  w .ja  v  a 2  s  .  c  om*/
        startIndex = input.index();
        if (getSuppressedSet(startIndex).isNil()) {
            optimize_ll1 = false;
        }

        return super.adaptivePredict(input, decision, outerContext);
    } finally {
        optimize_ll1 = ll1opt;
    }
}