Class TokenStreamUtils

java.lang.Object
org.rumbledb.compiler.utils.TokenStreamUtils

public final class TokenStreamUtils extends Object
Utilities for querying and inspecting ANTLR token streams.
  • Method Details

    • getHiddenTextAfter

      public static String getHiddenTextAfter(org.antlr.v4.runtime.CommonTokenStream tokenStream, int previousTokenIndex)
      Concatenates hidden-channel tokens immediately following a token.
      Parameters:
      tokenStream - token stream containing the hidden tokens
      previousTokenIndex - index of the token preceding the hidden tokens
      Returns:
      the hidden text, or an empty string when no hidden tokens follow