AstParserIterator

An iterator for the AST parser.

Parameters

TTokenKind

The type of token kind.

Constructors

Link copied to clipboard
constructor(tokens: List<Token<out TTokenKind>>)

Functions

Link copied to clipboard
fun current(): Token<out TTokenKind>?

Returns the current token, which is the token that was previously consumed. This is equivalent to peeking one step back.

Link copied to clipboard
Link copied to clipboard
fun next(): Token<out TTokenKind>?

Returns the next token in the iteration.

Link copied to clipboard
fun peek(steps: Int = 1): Token<out TTokenKind>?

Peeks the next token without consuming it.

Link copied to clipboard
fun rewind(steps: Int = 1)

Rewinds the iterator by the specified number of steps.