TokenStream.getText

Return the text of all tokens within the specified {@code interval}. This method behaves like the following code (including potential exceptions) for violating preconditions of {@link #get}, but may be optimized by the specific implementation.

<pre> TokenStream stream = ...; String text = ""; for (int i = interval.a; i &lt;= interval.b; i++) { text += stream.get(i).getText(); } </pre>

@param interval The interval of tokens within this stream to get text for. @return The text of all tokens within the specified interval in this stream.

  1. Variant getText(Interval interval)
    interface TokenStream
    Variant
    getText
  2. Variant getText()
  3. Variant getText(RuleContext ctx)
  4. Variant getText(Token start, Token stop)

Throws

NullPointerException if {@code interval} is {@code null}

Meta