kgraphql / com.apurebase.kgraphql.request / Lexer

Lexer

data class Lexer

Constructors

<init>

Lexer(source: String)
Lexer(source: Source, options: Any? = null, lastToken: Token = Token(SOF), token: Token = lastToken, line: Int = 1, lineStart: Int = 0)

Properties

lastToken

The previously focused non-ignored token.

var lastToken: Token

line

The (1-indexed) line containing the current token.

var line: Int

lineStart

The character offset at which the current line begins.

var lineStart: Int

options

val options: Any?

source

val source: Source

token

The currently focused non-ignored token.

var token: Token

Functions

advance

Advances the token stream to the next non-ignored token.

fun advance(): Token

lookahead

Looks ahead and returns the next non-ignored token, but does not change the Lexer's state.

fun lookahead(): Token