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.

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

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

Meta