Farkle


DesigntimeFarkleBuild Module

Functions to create `Grammar`s and `PostProcessor`s from `DesigntimeFarkle`s.

Functions and values

Function or value Description

build df

Full Usage: build df

Parameters:
Returns: Result<Grammar, BuildError list> * PostProcessor<'TOutput>

Creates a `Grammar` and a `PostProcessor` from a typed `DesigntimeFarkle`. The construction of the grammar may fail. In this case, the output of the post-processor is indeterminate. Using this function (and all others in this module) will always build a new grammar, even if a precompiled one is available.

df : DesigntimeFarkle<'TOutput>
Returns: Result<Grammar, BuildError list> * PostProcessor<'TOutput>

buildEx ct options df

Full Usage: buildEx ct options df

Parameters:
Returns: Result<Grammar, BuildError list> * PostProcessor<'TOutput>

Creates a `Grammar` and a `PostProcessor` from a typed `DesigntimeFarkle`. The construction of the grammar may fail. In this case, the output of the post-processor is indeterminate. Using this function (and all others in this module) will always build a new grammar, even if a precompiled one is available. This function also allows the build to be cancelled and further configured.

ct : CancellationToken
options : BuildOptions
df : DesigntimeFarkle<'TOutput>
Returns: Result<Grammar, BuildError list> * PostProcessor<'TOutput>

buildGrammarOnly grammarDef

Full Usage: buildGrammarOnly grammarDef

Parameters:
Returns: Result<Grammar, BuildError list>

Creates a `Grammar` from a `GrammarDefinition`.

grammarDef : GrammarDefinition
Returns: Result<Grammar, BuildError list>

buildGrammarOnlyEx ct options grammarDef

Full Usage: buildGrammarOnlyEx ct options grammarDef

Parameters:
Returns: Result<Grammar, BuildError list>

Creates a `Grammar` from a `GrammarDefinition`. The operation can be cancelled, throwing an `OperationCanceledException`. It also accepts a `BuildOptions` object, allowing further configuration.

ct : CancellationToken
options : BuildOptions
grammarDef : GrammarDefinition
Returns: Result<Grammar, BuildError list>

buildPostProcessorOnly df

Full Usage: buildPostProcessorOnly df

Parameters:
Returns: PostProcessor<'TOutput>

Creates a `PostProcessor` from the given `DesigntimeFarkle`. By not creating a grammar, some potentially expensive steps are skipped. This function is useful only for some very limited scenarios, such as having many designtime Farkles with an identical grammar but different post-processors.

df : DesigntimeFarkle<'TOutput>
Returns: PostProcessor<'TOutput>

createGrammarDefinition df

Full Usage: createGrammarDefinition df

Parameters:
Returns: GrammarDefinition

Creates a `GrammarDefinition` from an untyped `DesigntimeFarkle`.

df : DesigntimeFarkle
Returns: GrammarDefinition