build

fun build(startRule: String? = null): Grammar

Constructs a Grammar from the registered lexemes and rules.

The optional startRule parameter specifies the default rule to use when parsing without an explicit rule specified.

Return

The constructed Grammar

Parameters

startRule

The name of the default start rule, or null for no default

Throws

if no rules have been defined