WalkerParser

open class WalkerParser<T>(source: CharSequence, grammar: Grammar<T>)

Lexer and parser that, thanks to better-parse's context-free Grammar, can parse a string into a structured object. The term Walker refers to the fact this might be invoked by Quarkdown's lexer to walk through the source string, in case content cannot be tokenized via regular expressions.

Parameters

T

the type of the parsed object

source

the content to be parsed

grammar

the grammar that defines the parsing rules

See also

Inheritors

Constructors

Link copied to clipboard
constructor(source: CharSequence, grammar: Grammar<T>)

Functions

Link copied to clipboard

Parses the source string into an output object according to the grammar-defined rules. The parser interrupts when it reaches the end of the source string or when it encounters a syntax error.