group

fun <G : Node> group(pattern: RuleBuilder<G>.() -> Unit): RuleBuilder<N>

Adds an anonymous inline nonterminal rule reference.

The pattern lambda receives a RuleBuilder where multiple productions can be defined. This creates an anonymous Rule that is referenced inline, useful for Node-producing nonterminals without defining a named rule as a top-level Grammar member.

Return

this RuleBuilder for chaining

Parameters

G

The Node type produced by the anonymous Rule

pattern

A lambda defining the anonymous Rule's productions