element

Adds a custom PatternElement to the current production.

This method allows adding pattern elements that are constructed directly rather than through the DSL methods.

Return

this RuleBuilder for chaining

Parameters

element

The pattern element to add


inline fun element(crossinline element: () -> PatternElement): RuleBuilder<N>

Adds a custom PatternElement to the current production.

This method allows adding pattern elements that are constructed directly rather than through the DSL methods. The element is constructed by calling the provided element lambda.

Return

this RuleBuilder for chaining

Parameters

element

A lambda that constructs the pattern element to add