Package org.rumbledb.compiler.utils
Class TokenStreamUtils
java.lang.Object
org.rumbledb.compiler.utils.TokenStreamUtils
Utilities for querying and inspecting ANTLR token streams.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetHiddenTextAfter(org.antlr.v4.runtime.CommonTokenStream tokenStream, int previousTokenIndex) Concatenates hidden-channel tokens immediately following a token.
-
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 tokenspreviousTokenIndex- index of the token preceding the hidden tokens- Returns:
- the hidden text, or an empty string when no hidden tokens follow
-