TokenStore

interface TokenStore : Iterable<Token>

An ID-addressable token view.

Unlike List, the first retained token need not have ID zero. Iteration is in lexical order, while get always uses the absolute Token.id.

Properties

Link copied to clipboard
abstract val firstTokenId: Int

Absolute ID of the first retained token.

Link copied to clipboard
abstract val lastTokenId: Int

Absolute ID of the last token, forcing production through EOF for lazy stores.

Link copied to clipboard
abstract val retainedCount: Int

Number of tokens currently retained without forcing additional lexing.

Functions

Link copied to clipboard
abstract operator fun get(tokenId: Int): Token

Returns the token with absolute tokenId, forcing forward production when supported.

Link copied to clipboard
abstract operator fun iterator(): Iterator<Token>
Link copied to clipboard
open fun toList(): List<Token>

Returns retained tokens in lexical order, forcing production through EOF for lazy stores.