Parser

interface Parser<T, E, R>

Reads tokens from a list and parses it with a pratt-parser.

Author

AdrianTodt

Parameters

T

The parser's (and grammar's) token type.

E

The parser's (and grammar's) expression result.

R

The parser's result.

Types

Companion
Link copied to clipboard
common
object Companion

Functions

parse
Link copied to clipboard
common
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.

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

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

Properties

grammar
Link copied to clipboard
common
abstract val grammar: Grammar<T, E>

The Grammar of this pratt-parser.