Production
Represents one alternative pattern that a Rule is allowed to match against input.
A Production defines a sequence of PatternElements to match, and a factory function/lambda (producer) to construct the resulting Node from captured tokens and child nodes.
The leftRecursion flag indicates whether this production begins with a reference to its own rule, enabling special handling for left-recursive grammars. (Note: do not include an explicit reference to this Rule as first element in the production pattern; left-recursion is handled in a mechanism separate to the primary pattern logic within parse and extendLeftRecursion.)
The produced Node's children is automatically populated with the captured tokens and child nodes; custom producers should only be used to populate additional computed data relevant to the production/node. If you have no additional data to compute, you can produce a Generic Node with the no-argument produces function instead.
Parameters
The type of Node produced by this production
Properties
Whether this production is left-recursive (i.e. starts with a reference to itself)
The sequence of PatternElements to match
A factory lambda that constructs an instance of N from the captured elements