TokenInputStream

A TokenInputStream provides the Tokens for a Parser. It is created by a lexer

Since

0.1.0

Inheritors

Properties

Link copied to clipboard
abstract val actual: T

Returns the actual Token

Link copied to clipboard
open val actualEnd: Int

Returns the end of the actual token

Link copied to clipboard

Checks if the actual token without changing the actual token

Link copied to clipboard
open val actualStart: Int

Returns the start of the actual token

Link copied to clipboard
open val actualType: TT

Returns the type of the actual token

Link copied to clipboard
open val actualValue: String?

Returns the value of the actual

Link copied to clipboard
abstract val map: PositionMap

The map for the token-positions We have this map to resolve the column / line of an index. This is useful for error-generation.

Link copied to clipboard
abstract val position: Int

The position that the TokenInputStream is actually at

Link copied to clipboard
abstract val size: Int

The size of the TokenInputStream

Link copied to clipboard
abstract val source: String

The source (mostly filename) of the TokenInputStream

Functions

Link copied to clipboard
abstract fun has(num: Int): Boolean

Checks if the TokenInputStream has left a given number of tokens

Link copied to clipboard
open operator fun hasNext(): Boolean

Checks if the TokenInputStream has a token left

Link copied to clipboard
open operator fun next(): T

Returns the next token of the TokenInputStream (and skips)

Link copied to clipboard
open fun nextType(): TT

Returns the type of the next token of the TokenInputStream (and skips)

Link copied to clipboard
open fun nextValue(): String?

Returns the next token of the TokenInputStream

Link copied to clipboard
open fun peek(): T

Returns the next Token

abstract fun peek(offset: Int): T

Peek the token at the given index

Link copied to clipboard
open fun peekEnd(): Int

Returns the end of the next token without changing the actual token

open fun peekEnd(offset: Int): Int

Peek the token end at the given index

Link copied to clipboard
open fun peekHasValue(): Boolean

Checks if the next token of the TokenInputStream has a value without skipping

open fun peekHasValue(offset: Int): Boolean

Checks if the token at the given offset of the TokenInputStream has a value without changing the actual token

Link copied to clipboard
open fun peekStart(): Int

Returns the start of the next token without changing the actual token

open fun peekStart(offset: Int): Int

Peek the token start at the given index

Link copied to clipboard
open fun peekType(): TT

Returns the type of the next token without changing the actual token

open fun peekType(offset: Int): TT

Peek the token type at the given index

Link copied to clipboard
open fun peekValue(): String?

Returns the value of the next token without changing the actual token

open fun peekValue(offset: Int): String?

Peek the token value at the given index

Link copied to clipboard
abstract fun skip()

Skips the next token

abstract fun skip(amount: Int)

Skips a number of tokens