Farkle


DesigntimeFarkleOperators Module

F# operators to easily work with designtime Farkles and production builders.

Functions and values

Function or value Description

!%df

Full Usage: !%df

Parameters:
Returns: ProductionBuilder

Creates a production builder with one non-significant `DesigntimeFarkle`. This function is useful to start building a `Production`.

df : DesigntimeFarkle
Returns: ProductionBuilder

!&str

Full Usage: !&str

Parameters:
    str : string

Returns: ProductionBuilder

Creates a production builder with one non-significant string literal.

str : string
Returns: ProductionBuilder

!@df

Full Usage: !@df

Parameters:
Returns: ProductionBuilder<'T>

Creates a production builder with one significant `DesigntimeFarkle<'T>`. This function is useful to start building a `Production`.

df : DesigntimeFarkle<'T>
Returns: ProductionBuilder<'T>

pb =% x

Full Usage: pb =% x

Parameters:
Returns: Production<'T>

`ProductionBuilder.FinishConstant` as an operator.

pb : ProductionBuilder
x : 'T
Returns: Production<'T>

df |>> f

Full Usage: df |>> f

Parameters:
Returns: DesigntimeFarkle<'b>

Creates a new `DesigntimeFarkle<'T>` that transforms the output of the given one with the given function.

df : DesigntimeFarkle<'a>
f : 'a -> 'b
Returns: DesigntimeFarkle<'b>

name ||= members

Full Usage: name ||= members

Parameters:
Returns: DesigntimeFarkle<'a>

Creates a `DesigntimeFarkle<'T>` that represents a nonterminal with the given name and productions.

name : string
members : Production<'a> list
Returns: DesigntimeFarkle<'a>

name |||= members

Full Usage: name |||= members

Parameters:
Returns: DesigntimeFarkle
name : string
members : ProductionBuilder list
Returns: DesigntimeFarkle

asIs pb

Full Usage: asIs pb

Parameters:
Returns: Production<'T>

An alias for ``ProductionBuilder`1.AsIs``.

pb : ProductionBuilder<'T>
Returns: Production<'T>

empty

Full Usage: empty

Returns: ProductionBuilder

An alias for `ProductionBuilder.Empty`.

Returns: ProductionBuilder

error msg

Full Usage: error msg

Parameters:
    msg : string

Returns: 'a

Raises an error that happened during the parsing process. In contrast with raising an exception, these errors are caught by the `RuntimeFarkle` API and track their position. Use this function when the error might occur under normal circumstances (such as an unknown identifier name in a programming language).

msg : string
Returns: 'a

errorf fmt

Full Usage: errorf fmt

Parameters:
    fmt : StringFormat<'a, 'b>

Returns: 'a

An edition of `error` that supports formatted strings.

fmt : StringFormat<'a, 'b>
Returns: 'a

literal str

Full Usage: literal str

Parameters:
    str : string

Returns: DesigntimeFarkle

An alias for the `Terminal.Literal` function.

str : string
Returns: DesigntimeFarkle

many df

Full Usage: many df

Parameters:
Returns: DesigntimeFarkle<'a list>

Creates a designtime Farkle that recognizes many occurrences of the given one and returns them in a list.

df : DesigntimeFarkle<'a>
Returns: DesigntimeFarkle<'a list>

many1 df

Full Usage: many1 df

Parameters:
Returns: DesigntimeFarkle<'a list>

Creates a designtime Farkle that recognizes more than one occurrences of the given one and returns them in a list.

df : DesigntimeFarkle<'a>
Returns: DesigntimeFarkle<'a list>

manyCollection df

Full Usage: manyCollection df

Parameters:
Returns: DesigntimeFarkle<'TCollection>

Creates a designtime Farkle that recognizes many occurrences of the given one and returns them in any collection type.

df : DesigntimeFarkle<'T>
Returns: DesigntimeFarkle<'TCollection>

manyCollection1 df

Full Usage: manyCollection1 df

Parameters:
Returns: DesigntimeFarkle<'TCollection>

Creates a designtime Farkle that recognizes more than one occurrences of the given one and returns them in any collection type.

df : DesigntimeFarkle<'T>
Returns: DesigntimeFarkle<'TCollection>

newline

Full Usage: newline

Returns: DesigntimeFarkle

An alias for `Terminal.NewLine`.

Returns: DesigntimeFarkle

nonterminal name

Full Usage: nonterminal name

Parameters:
    name : string

Returns: Nonterminal<'a>

Creates a `Nonterminal` whose productions must be later set with `SetProductions`, or it will raise an error on building. Useful for recursive productions.

name : string
Returns: Nonterminal<'a>

nonterminalU name

Full Usage: nonterminalU name

Parameters:
    name : string

Returns: Nonterminal

Creates an `Untyped.Nonterminal` whose productions must be later set with `SetProductions`, or it will raise an error on building. Useful for recursive productions.

name : string
Returns: Nonterminal

opt df

Full Usage: opt df

Parameters:
Returns: DesigntimeFarkle<'a option>

Creates a `DesigntimeFarkle<'T>` that recognizes `df`, which might not be found. In this case, the resulting value is `None`.

df : DesigntimeFarkle<'a>
Returns: DesigntimeFarkle<'a option>

prec token pb

Full Usage: prec token pb

Parameters:
    token : obj
    pb : ^TBuilder

Returns: ^TBuilder
Modifiers: inline
Type parameters: ^TBuilder

An alias for the `WithPrecedence` method of production builders.

token : obj
pb : ^TBuilder
Returns: ^TBuilder

sepBy sep df

Full Usage: sepBy sep df

Parameters:
Returns: DesigntimeFarkle<'a list>

Creates a designtime Farkle that recognizes many occurrences of `df` separated by `sep` and returns them in a list.

sep : DesigntimeFarkle
df : DesigntimeFarkle<'a>
Returns: DesigntimeFarkle<'a list>

sepBy1 sep df

Full Usage: sepBy1 sep df

Parameters:
Returns: DesigntimeFarkle<'a list>

Creates a designtime Farkle that recognizes more than one occurrences of `df` separated by `sep` and returns them in a list.

sep : DesigntimeFarkle
df : DesigntimeFarkle<'a>
Returns: DesigntimeFarkle<'a list>

sepByCollection sep df

Full Usage: sepByCollection sep df

Parameters:
Returns: DesigntimeFarkle<'TCollection>

Creates a designtime Farkle that recognizes many occurrences of `df` separated by `sep` and returns them in any collection type.

sep : DesigntimeFarkle
df : DesigntimeFarkle<'T>
Returns: DesigntimeFarkle<'TCollection>

sepByCollection1 sep df

Full Usage: sepByCollection1 sep df

Parameters:
Returns: DesigntimeFarkle<'TCollection>

Creates a designtime Farkle that recognizes more than one occurrences of `df` separated by `sep` and returns them in any collection type.

sep : DesigntimeFarkle
df : DesigntimeFarkle<'T>
Returns: DesigntimeFarkle<'TCollection>

terminal name fTransform regex

Full Usage: terminal name fTransform regex

Parameters:
    name : string
    fTransform : T<'a>
    regex : Regex

Returns: DesigntimeFarkle<'a>

Creates a terminal with the given name, specified by the given `Regex`. Its content will be post-processed by the given `T` delegate.

name : string
fTransform : T<'a>
regex : Regex
Returns: DesigntimeFarkle<'a>

terminalU name regex

Full Usage: terminalU name regex

Parameters:
    name : string
    regex : Regex

Returns: DesigntimeFarkle

Creates a terminal with the given name, specified by the given `Regex`, but not returning anything.

name : string
regex : Regex
Returns: DesigntimeFarkle

virtualTerminal name

Full Usage: virtualTerminal name

Parameters:
    name : string

Returns: DesigntimeFarkle

An alias for the `Terminal.Virtual` function.

name : string
Returns: DesigntimeFarkle