Lexer

data class Lexer(source: Source, options: Any?, lastToken: Token, token: Token, line: Int, lineStart: Int)

Constructors

Lexer
Link copied to clipboard
fun Lexer(source: String)

Functions

advance
Link copied to clipboard
fun advance(): Token
Advances the token stream to the next non-ignored token.
lookahead
Link copied to clipboard
fun lookahead(): Token
Looks ahead and returns the next non-ignored token, but does not change the Lexer's state.

Properties

lastToken
Link copied to clipboard
var lastToken: Token
The previously focused non-ignored token.
line
Link copied to clipboard
var line: Int = 1
The (1-indexed) line containing the current token.
lineStart
Link copied to clipboard
var lineStart: Int = 0
The character offset at which the current line begins.
options
Link copied to clipboard
val options: Any? = null
source
Link copied to clipboard
val source: Source
token
Link copied to clipboard
var token: Token
The currently focused non-ignored token.