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

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

Introduction

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

Prototype

@Override
    public int index() 

Source Link

Usage

From source file:org.eclipse.titan.common.parsers.IntervalDetector.java

License:Open Source License

/**
 * Pops the actual interval off of the stack, making its parent the actual interval. The ending offset of the popped off interval is set here.
 * <p>//from   w  w w  .ja v a2  s .  c o m
 * If the actual interval is the root interval, than it is not popped off the stack. This situation can only happen in case of a syntactically
 * invalid file.
 * <p>
 * The last non-hidden token will be the end of the interval.
 *
 * @param aTokenStream token stream to get the list of tokens for searching hidden tokens
 */
public final void popInterval(final CommonTokenStream aTokenStream) {
    final int nonHiddenIndex = getNonHiddenTokensBefore(aTokenStream.index() - 1, aTokenStream.getTokens());
    final Token t = aTokenStream.get(nonHiddenIndex);
    popInterval(t);
}