Add {@code n} elements to the buffer. Returns the number of tokens actually added to the buffer. If the return value is less than {@code n}, then EOF was reached before {@code n} tokens could be added.
@uml @override
Return a marker that we can release later.
Make sure we have 'need' elements from current position {@link #p p}. Last valid {@code p} index is {@code tokens.length-1}. {@code p+need-1} is the tokens index 'need' elements ahead. If we need 1 element, {@code (p+1-1)==p} must be less than {@code tokens.length}.
@uml The number of tokens currently in {@link #tokens tokens}.
@uml Count up with {@link #mark mark()} and down with {@link #release release()}. When we {@code release()} the last mark, {@code numMarkers} reaches 0 and we reset the buffer. Copy {@code tokensp..tokens[n-1]} to {@code tokens[0]..tokens[(n-1)-p]}.
@uml 0..n-1 index into {@link #tokens tokens} of next token.
@uml A moving window buffer of the data being scanned. While there's a marker, we keep adding to buffer. Otherwise, {@link #consume consume()} resets so we start filling at index 0 again.
Get the {@link Token} instance associated with the value returned by {@link #LA LA(k)}. This method has the same pre- and post-conditions as {@link IntStream#LA}. In addition, when the preconditions of this method are met, the return value is non-null and the value of {@code LT(k).getType()==LA(k)}.
Gets the {@link Token} at the specified {@code index} in the stream. When the preconditions of this method are met, the return value is non-null.
Gets the underlying {@link TokenSource} which provides tokens for this stream.
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.
Return the text of all tokens in the stream. This method behaves like the following code, including potential exceptions from the calls to {@link IntStream#size} and {@link #getText(Interval)}, but may be optimized by the specific implementation.
Return the text of all tokens in the source interval of the specified context. This method behaves like the following code, including potential exceptions from the call to {@link #getText(Interval)}, but may be optimized by the specific implementation.
Return the text of all tokens in this stream between {@code start} and {@code stop} (inclusive).
TODO add class description