parse

abstract fun parse(source: Source, tokens: List<Token<T>>): R

Parses tokens with this pratt-parser and returns the computed result.

Return

The computed result.

Parameters

source

A source of characters.

tokens

A list of tokens, probably created with Lexer.

open fun parse(source: Source, lexer: Lexer<Token<T>>): R

Parses tokens from a source, using a specified lexer, with this pratt-parser, and returns the computed result.

Return

The computed result.

Parameters

source

A source of characters.

lexer

A lexer to parse the source.