Farkle


Terminals Module

Some designtime Farkles that are commonly used in many grammars.

These functions take a name and create a designtime Farkle which is meant to be reused everywhere it is needed in the grammar. Creating and using many designtime Farkles of the same or similar kind will almost certainly lead to an error.

Nested modules

Modules Description

Internal

This module is public due to compiler limitations. Do not use it; it is subject to be removed or altered at any time.

Functions and values

Function or value Description

Terminals.decimal name

Full Usage: Terminals.decimal name

Parameters:
    name : string

Returns: DesigntimeFarkle<decimal>

Creates a designtime Farkle that parses and returns a signed decimal floating-point number. The number is expected to be written in scientific notation, with the decimal point symbol being the dot.

name : string
Returns: DesigntimeFarkle<decimal>

Terminals.float name

Full Usage: Terminals.float name

Parameters:
    name : string

Returns: DesigntimeFarkle<float>

Creates a designtime Farkle that parses and returns a signed double-precision floating-point number. The number is expected to be written in scientific notation, with the decimal point symbol being the dot. Special values such as NaN or infinity are not recognized.

name : string
Returns: DesigntimeFarkle<float>

Terminals.float32 name

Full Usage: Terminals.float32 name

Parameters:
    name : string

Returns: DesigntimeFarkle<float32>

Creates a designtime Farkle that parses and returns a signed single-precision floating-point number. The number is expected to be written in scientific notation, with the decimal point symbol being the dot. Special values such as NaN or infinity are not recognized.

name : string
Returns: DesigntimeFarkle<float32>

Terminals.genericReal allowSign name

Full Usage: Terminals.genericReal allowSign name

Parameters:
    allowSign : bool
    name : string

Returns: DesigntimeFarkle<^TReal>
Modifiers: inline
Type parameters: ^TReal

Creates a designtime Farkle that parses a real number into the desired number type. No bounds checking is performed. Using this function from a language other than F# will throw an exception.

allowSign : bool
name : string
Returns: DesigntimeFarkle<^TReal>

Terminals.genericSigned name

Full Usage: Terminals.genericSigned name

Parameters:
    name : string

Returns: DesigntimeFarkle<^TInt>
Modifiers: inline
Type parameters: ^TInt

Creates a designtime Farkle that parses a signed decimal integer into the desired number type. No bounds checking is performed. The type parameter must support the unary negation operator. Using this function from a language other than F# will throw an exception.

name : string
Returns: DesigntimeFarkle<^TInt>

Terminals.genericUnsigned name

Full Usage: Terminals.genericUnsigned name

Parameters:
    name : string

Returns: DesigntimeFarkle<^TInt>
Modifiers: inline
Type parameters: ^TInt

Creates a designtimeFarkle that parses an unsigned decimal integer into the desired number type. No bounds checking is performed. Using this function from a language other than F# will throw an exception.

name : string
Returns: DesigntimeFarkle<^TInt>

Terminals.int name

Full Usage: Terminals.int name

Parameters:
    name : string

Returns: DesigntimeFarkle<int>

Creates a designtime Farkle that parses and returns a signed 32-bit signed integer. No bounds checking is performed.

name : string
Returns: DesigntimeFarkle<int>

Terminals.int64 name

Full Usage: Terminals.int64 name

Parameters:
    name : string

Returns: DesigntimeFarkle<int64>

Creates a designtime Farkle that parses and returns a signed 64-bit signed integer. No bounds checking is performed.

name : string
Returns: DesigntimeFarkle<int64>

Terminals.signedIntRegex

Full Usage: Terminals.signedIntRegex

Returns: Regex

A `Regex` that recognizes a series of decimal digits that might be prefixed with a minus sign "-". Leading zeros are accepted.

Returns: Regex

Terminals.signedRealRegex

Full Usage: Terminals.signedRealRegex

Returns: Regex

Like `unsignedRealRegex`, but with an optional sign in the beginning being allowed.

Returns: Regex

Terminals.string delim name

Full Usage: Terminals.string delim name

Parameters:
    delim : char
    name : string

Returns: DesigntimeFarkle<string>

Creates a designtime Farkle that can recognize a single-line, C-like string.

delim : char
name : string
Returns: DesigntimeFarkle<string>

Terminals.stringEx escapeChars allowEscapeUnicode multiline delim name

Full Usage: Terminals.stringEx escapeChars allowEscapeUnicode multiline delim name

Parameters:
    escapeChars : char seq - A sequence of valid escape characters after the backslash. If one of abfnrtv is included, it will be treated as a developer would expect. Any other character will be output verbatim. The backslash and the string delimiter are always escaped. Specifying u will be ignored.
    allowEscapeUnicode : bool - Whether to allow escaping Unicode characters with \\u, followed by exactly four case-insensitive hex digits.
    multiline : bool - Whether to allow line breaks in the string. They will be interpreted as literal line breaks.
    delim : char - The character that marks the start and the end of the string. In most programming languages, it is either a single or a double quote.
    name : string - The name of the resulting designtime Farkle.

Returns: DesigntimeFarkle<string>

Creates a designtime Farkle that can recognize a C-like string. It supports escaping with a backslash "\\".

escapeChars : char seq

A sequence of valid escape characters after the backslash. If one of abfnrtv is included, it will be treated as a developer would expect. Any other character will be output verbatim. The backslash and the string delimiter are always escaped. Specifying u will be ignored.

allowEscapeUnicode : bool

Whether to allow escaping Unicode characters with \\u, followed by exactly four case-insensitive hex digits.

multiline : bool

Whether to allow line breaks in the string. They will be interpreted as literal line breaks.

delim : char

The character that marks the start and the end of the string. In most programming languages, it is either a single or a double quote.

name : string

The name of the resulting designtime Farkle.

Returns: DesigntimeFarkle<string>

Terminals.uint32 name

Full Usage: Terminals.uint32 name

Parameters:
    name : string

Returns: DesigntimeFarkle<uint32>

Creates a designtime Farkle that parses and returns a signed 32-bit unsigned integer. No bounds checking is performed.

name : string
Returns: DesigntimeFarkle<uint32>

Terminals.uint64 name

Full Usage: Terminals.uint64 name

Parameters:
    name : string

Returns: DesigntimeFarkle<uint64>

Creates a designtime Farkle that parses and returns a signed 64-bit unsigned integer. No bounds checking is performed.

name : string
Returns: DesigntimeFarkle<uint64>

Terminals.unsignedIntRegex

Full Usage: Terminals.unsignedIntRegex

Returns: Regex

A `Regex` that recognizes a series of decimal digits. Leading zeros are accepted.

Returns: Regex

Terminals.unsignedRealRegex

Full Usage: Terminals.unsignedRealRegex

Returns: Regex

A `Regex` that recognizes an unsigned real number. The number is expected to be written in scientific notation, with the decimal point symbol being the dot. Numbers before or after the dot are optional, but they must exist in at least one of the two places.

Returns: Regex