LookaheadIterator

A class that is used to look up valid symbols in a specific parse state.

Lookahead iterators can be useful to generate suggestions and improve syntax error diagnostics. To get symbols valid in an ERROR node, use the lookahead iterator on its first leaf node state. For MISSING nodes, a lookahead iterator created on the previous non-extra leaf node may be appropriate.

NOTE: If you're targeting Android SDK level < 33, you must use or close the instance to free up resources.

A class that is used to look up valid symbols in a specific parse state.

Lookahead iterators can be useful to generate suggestions and improve syntax error diagnostics. To get symbols valid in an ERROR node, use the lookahead iterator on its first leaf node state. For MISSING nodes, a lookahead iterator created on the previous non-extra leaf node may be appropriate.

A class that is used to look up valid symbols in a specific parse state.

Lookahead iterators can be useful to generate suggestions and improve syntax error diagnostics. To get symbols valid in an ERROR node, use the lookahead iterator on its first leaf node state. For MISSING nodes, a lookahead iterator created on the previous non-extra leaf node may be appropriate.

A class that is used to look up valid symbols in a specific parse state.

Lookahead iterators can be useful to generate suggestions and improve syntax error diagnostics. To get symbols valid in an ERROR node, use the lookahead iterator on its first leaf node state. For MISSING nodes, a lookahead iterator created on the previous non-extra leaf node may be appropriate.

Types

Link copied to clipboard
actual data class Symbol(val id: UShort, val name: String) : Record

A class that pairs a symbol ID with its name.

expect class Symbol(id: UShort, name: String)

A class that pairs a symbol ID with its name.

actual data class Symbol(val id: UShort, val name: String) : Record

A class that pairs a symbol ID with its name.

actual data class Symbol(val id: UShort, val name: String)

A class that pairs a symbol ID with its name.

Properties

Link copied to clipboard
@get:JvmName(name = "getCurrentSymbol")
actual val currentSymbol: UShort

The current symbol ID.

expect val currentSymbol: UShort

The current symbol ID.

@get:JvmName(name = "getCurrentSymbol")
actual val currentSymbol: UShort

The current symbol ID.

actual val currentSymbol: UShort

The current symbol ID.

Link copied to clipboard

The current symbol name.

The current symbol name.

The current symbol name.

The current symbol name.

Link copied to clipboard
actual val language: Language

The current language of the lookahead iterator.

expect val language: Language

The current language of the lookahead iterator.

actual val language: Language

The current language of the lookahead iterator.

actual val language: Language

The current language of the lookahead iterator.

Functions

Link copied to clipboard
open override fun close()
forEachRemaining
Link copied to clipboard
hasNext
Link copied to clipboard
open operator override fun hasNext(): Boolean
open operator override fun hasNext(): Boolean
open operator override fun hasNext(): Boolean
open operator override fun hasNext(): Boolean
iterator
Link copied to clipboard
operator fun iterator(): LookaheadIterator
operator fun iterator(): LookaheadIterator
operator fun iterator(): LookaheadIterator
Link copied to clipboard
actual open operator override fun next(): LookaheadIterator.Symbol

Advance the lookahead iterator to the next symbol.

expect open operator override fun next(): LookaheadIterator.Symbol

Advance the lookahead iterator to the next symbol.

actual open operator override fun next(): LookaheadIterator.Symbol

Advance the lookahead iterator to the next symbol.

actual open operator override fun next(): LookaheadIterator.Symbol

Advance the lookahead iterator to the next symbol.

Link copied to clipboard
@JvmName(name = "reset")
actual external fun reset(state: UShort, language: Language?): Boolean

Reset the lookahead iterator the given state and, optionally, another language.

expect fun reset(state: UShort, language: Language? = null): Boolean

Reset the lookahead iterator the given state and, optionally, another language.

@JvmName(name = "reset")
actual external fun reset(state: UShort, language: Language?): Boolean

Reset the lookahead iterator the given state and, optionally, another language.

actual fun reset(state: UShort, language: Language?): Boolean

Reset the lookahead iterator the given state and, optionally, another language.

Link copied to clipboard
actual fun symbolNames(): Sequence<String>

Iterate over the symbol names.

expect fun symbolNames(): Sequence<String>

Iterate over the symbol names.

actual fun symbolNames(): Sequence<String>

Iterate over the symbol names.

actual fun symbolNames(): Sequence<String>

Iterate over the symbol names.

Link copied to clipboard
actual fun symbols(): Sequence<UShort>

Iterate over the symbol IDs.

expect fun symbols(): Sequence<UShort>

Iterate over the symbol IDs.

actual fun symbols(): Sequence<UShort>

Iterate over the symbol IDs.

actual fun symbols(): Sequence<UShort>

Iterate over the symbol IDs.