Skip tokens on any channel but this one; this is how we skip whitespace...
Map from token type to channel to override some Tokens' channel numbers
By default, track all incoming this.tokens
Set of token types; discard any this.tokens with this type
Track the last mark() call result value for use in rewind().
The index into the this.tokens list of the current token (next token to consume). p==-1 indicates that the this.tokens list is empty
How deep have we gone?
Record every single token pulled from the source so we can reproduce chunks of it later.
Move the input pointer to the next incoming token. The stream must become active with LT(1) available. consume() simply moves the input pointer so that LT(1) points at the next input symbol. Consume at least one token.
Walk past any token not on the channel the parser is listening to.
Load all this.tokens from the token source and put in this.tokens. This is done upon first LT request because you might want to set some token type / channel overrides before filling buffer.
Return absolute token i; ignore which channel the this.tokens are on; that is, count all this.tokens not just on-channel this.tokens.
Look backwards k this.tokens on-channel this.tokens
Get the ith token from the current position 1..n where k=1 is the first symbol of lookahead.
Reset this token stream by setting its token source.
A simple filter mechanism whereby you can tell this token stream to force all this.tokens of type ttype to be on channel. For example, when interpreting, we cannot exec actions so we need to tell the stream to force all WS and NEWLINE to be a different, ignored channel.
Given a starting index, return the index of the first on-channel token.
Generated using TypeDoc
The most common stream of this.tokens is one where every token is buffered up and this.tokens are prefiltered for a certain channel (the parser will only see these this.tokens and cannot change the filter channel number during the parse).
TODO: how to access the full token stream? How to track all this.tokens matched per rule?