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.
Modules | Description |
This module is public due to compiler limitations. Do not use it; it is subject to be removed or altered at any time. |
Function or value | Description |
|
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.
|
|
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.
|
|
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.
|
Full Usage:
Terminals.genericReal allowSign name
Parameters:
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.
|
Full Usage:
Terminals.genericSigned name
Parameters:
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.
|
Full Usage:
Terminals.genericUnsigned name
Parameters:
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.
|
|
Creates a designtime Farkle that parses and returns a signed 32-bit signed integer. No bounds checking is performed.
|
|
Creates a designtime Farkle that parses and returns a signed 64-bit signed integer. No bounds checking is performed.
|
|
A `Regex` that recognizes a series of decimal digits that might be prefixed with a minus sign "-". Leading zeros are accepted.
|
|
Like `unsignedRealRegex`, but with an optional sign in the beginning being allowed.
|
Full Usage:
Terminals.string delim name
Parameters:
char
name : string
Returns: DesigntimeFarkle<string>
|
Creates a designtime Farkle that can recognize a single-line, C-like string.
|
Full Usage:
Terminals.stringEx escapeChars allowEscapeUnicode multiline delim name
Parameters:
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 "\\".
|
|
Creates a designtime Farkle that parses and returns a signed 32-bit unsigned integer. No bounds checking is performed.
|
|
Creates a designtime Farkle that parses and returns a signed 64-bit unsigned integer. No bounds checking is performed.
|
|
A `Regex` that recognizes a series of decimal digits. Leading zeros are accepted.
|
|
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.
|