OnDemandLexingTokenInputStream

A TokenInputStream that generates tokens on demand (from a LexingBase)

Since

0.1.0

Constructors

Link copied to clipboard
constructor(lexingBase: LexingBase<TT, T>)

Properties

Link copied to clipboard
open lateinit override var actual: T
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
Link copied to clipboard
Link copied to clipboard
open override val map: PositionMap

The PositionMap of the OnDemandLexingTokenInputStream (In this case it's a position maker, because the position map will be generated on demand)

Link copied to clipboard
open override var position: Int

The position of the OnDemandLexingTokenInputStream

Link copied to clipboard
open override val size: Int

The size of the TokenInputStream

Link copied to clipboard
open override val source: String

Functions

Link copied to clipboard
open fun createError(details: String, start: Position = input.positionMaker.createPositionAtLocation(), end: Position = start): LexingBase.LexerError
open fun createError(name: String, details: String, start: Position = input.positionMaker.createPositionAtLocation(), end: Position = start): LexingBase.LexerError
open fun createError(message: String, name: String, details: String, start: Position, end: Position): LexingBase.LexerError
Link copied to clipboard
open override fun has(num: Int): Boolean

Check if the TokenInputStream has a requested amount of tokens (This will try to generate the requested amount of tokens and fill the buffer, as this is the only way to check if the TokenInputStream has the requested amount of tokens)

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

Checks if the TokenInputStream has a token left

Link copied to clipboard
open override fun makeToken(): T

Make a token

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 override fun peek(offset: Int): T

Peek the next token

open fun peek(): T

Returns the next Token

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
open override fun skip()

Skip one token

open override fun skip(amount: Int)

Skip a requested amount of tokens

Link copied to clipboard
open override fun toString(): String

Get string representation of the OnDemandLexingTokenInputStream