build

fun build(): Rule<N>

Finalizes the current production and returns the built Rule instance.

When using Grammar.Builder's DSL, this function is called automatically. This function should only be called if you called this RuleBuilder's constructor directly rather than using the DSL.

Return

The built Rule instance

Throws

if no productions have been defined for this Rule, or if any trailing PatternElements were not bound to a producer