LimitTokenPositionFilter

constructor(in: TokenStream, maxTokenPosition: Int)

Build a filter that only accepts tokens up to and including the given maximum position. This filter will not consume any tokens with position greater than the maxTokenPosition limit.

Parameters

in

the stream to wrap

maxTokenPosition

max position of tokens to produce (1st token always has position 1)

See also


constructor(in: TokenStream, maxTokenPosition: Int, consumeAllTokens: Boolean)

Build a filter that limits the maximum position of tokens to emit.

Parameters

in

the stream to wrap

maxTokenPosition

max position of tokens to produce (1st token always has position 1)

consumeAllTokens

whether all tokens from the wrapped input stream must be consumed even if maxTokenPosition is exceeded.