The base, untyped class of the production builders.
A production builder is an object that helps to fluently construct Production{T}s
by aggregating the types of its significant members. The types of the production's
significant members are indicated by the type parameters. For example, a ProductionBuilder
has no
significant members, and a ProductionBuilder{int, string}
has two significant members: an integer
and a string.
Production builders have these common methods.
Append
returns a production builder with the same significant members,
but the given DesigntimeFarkle at the end of it. Alternatively, it can
accept a string which will be appended to the production as a literal.
Extend
returns a production builder with one more significant member,
whose type is determined by the given DesigntimeFarkle{T} that will
be appended to it.
Finish
accepts a function that converts all the builder's significant members
into the eventual type of the returned Production{T}. It comes in two editions:
one that takes an F# function and another one that takes a delegate.
WithPrecedence
accepts a unique object which will represent the production in
operator scopes, providing contextual precedence. An overload of this method accepts
a reference to a variable that will hold the object, which will be created by Farkle.
It allows C# programmers to use out var
instead of creating their own object.
Constructor | Description |
|
Creates a production builder whose members are the given objects. The objects must be either strings or characters (where they will be interpreted as literals), or designtime Farkles. Passing an object of different type will raise an exception.
|
Instance member | Description | ||
|
Creates a production builder from this one with the given string added to the end as a literal.
|
||
|
Creates a production builder from this one with the given untyped designtime Farkle added to the end as a not significant member.
|
||
|
Creates a production builder from this one with the given typed designtime Farkle added to the end as a significant member. Up to sixteen significant members can be added to a production builder.
|
||
|
Finishes the production's construction and returns it. This method accepts a delegate that returns the production's output.
|
||
|
|||
|
Finishes the production's construction and returns it. This method accepts an F# function that returns the production's output.
|
||
|
Like
This method is intended to be used when finishing a production with many significant members.
|
||
Full Usage:
this.WithPrecedence
Parameters:
outref<obj>
-
The reference that will be assigned a newly created object
which will serve as the production's contextual precedence token.
Returns: ProductionBuilder
|
Returns a production builder with a unique contextual precedence token assigned to it, which is also returned by reference. This method allows a simpler experience for C# users.
|
||
Full Usage:
this.WithPrecedence
Parameters:
obj
-
An object that identifies the production
when defining operator precedence and associativity.
Returns: ProductionBuilder
|
Returns a production builder with the given contextual precedence token.
|
Static member | Description |
Full Usage:
x .>> literal
Parameters:
ProductionBuilder
literal : string
Returns: ProductionBuilder
Modifiers: inline |
The
|
Full Usage:
x .>> df
Parameters:
ProductionBuilder
df : DesigntimeFarkle
Returns: ProductionBuilder
Modifiers: inline |
The
|
Full Usage:
x .>>. df
Parameters:
ProductionBuilder
df : DesigntimeFarkle<'a>
Returns: ProductionBuilder<'a>
Modifiers: inline Type parameters: 'a |
The
|
Full Usage:
x => f
Parameters:
ProductionBuilder
f : unit -> 'a
Returns: Production<'a>
Modifiers: inline Type parameters: 'a |
The
|
|
A production builder with no members.
|