- ParseFunction`2
- ParseResult
- ParseResult`1
- Parser
- IsAny``1(values)
- IsAny``1(values,comparer)
- IsNotAny``1(values)
- IsNotAny``1(values,comparer)
- IsNot``1(value)
- IsNot``1(value,comparer)
- IsSequence``1(value)
- IsSequence``1(value,comparer)
- Is``1(value)
- Is``1(value,comparer)
- TakeUntil``2(next,min)
- TakeWhile``1(predicate,min,max)
- TakeWhile``1(predicate,min,max)
- ParserExtensions
- Between``4(self,left,right)
- FollowedBy``3(self,next)
- ManyUntil``3(self,next,min)
- Many``2(self,min,max)
- Map``3(self,map)
- Optional``2(self,defaultValue)
- Or``2(self,other)
- PrecededBy``3(self,previous)
- Repeat``2(self,count)
- SkipMany``2(self,min,max)
- SkipUntil``3(self,next,min)
- Then``3(self,next)
- TryMap``3(self,tryMap)
- ParserPredicate`1
- Parser`2
- Range
Monda
Delegate that attempts to parse a result from an input data set, beginning at a specific point
A ParseResult`1 indicating the success or failure of the parse attempt
| Name | Type | Description |
|---|---|---|
| data | T:Monda.ParseFunction`2 | Input data to parse |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
| TResult | The result type of the parser |
Monda
Generic helper functions for constructing ParseResult`1 instances
Create a failure result with the default value for T
A failure ParseResult`1 with it's value set to default(T)
This method has no parameters.
| Name | Description |
|---|---|
| T | The underlying value type |
Create a failure result with a specified value
A failure ParseResult`1 with it's value set to value
| Name | Type | Description |
|---|---|---|
| value | ``0@ | The value of the result |
| Name | Description |
|---|---|
| T | The underlying value type |
Create a success result
| Name | Type | Description |
|---|---|---|
| value | ``0@ | The value of the result |
| start | System.Int32 | The position at which the result started |
| length | System.Int32 | The length of data used to parse value |
| Name | Description |
|---|---|
| T | The underlying value type |
Monda
Represents the result of a parsing operation
| Name | Description |
|---|---|
| TValue | Underlying value type |
The length of data in the data source used to construct this result
The position in the data source where this result started
Indicates if this result was successful
The underlying result value
Monda
Static Parser helper methods
Creates a Parser`2 that yields a single TSource item if it exists in values, using the default comparer for TSource to compare items
A Parser`2 that will succeed if the TSource item at the parser's current position exists in values
| Name | Type | Description |
|---|---|---|
| values | System.Collections.Generic.IReadOnlyList{``0} | Item to compare |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
| Name | Description |
|---|---|
| System.ArgumentNullException | values is null |
Creates a Parser`2 that yields a single TSource item if it exists in values, using comparer to compare values
A Parser`2 that will succeed if the TSource item at the parser's current position exists in values
| Name | Type | Description |
|---|---|---|
| values | System.Collections.Generic.IReadOnlyList{``0} | Item to compare |
| comparer | System.Collections.Generic.IEqualityComparer{``0} | Comparer to use to determine equality between TSource items |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
| Name | Description |
|---|---|
| System.ArgumentException | values is empty |
| System.ArgumentNullException | values or comparer is null |
Creates a Parser`2 that yields a single TSource item if it does not exist in values, using the default comparer for TSource to compare items
A Parser`2 that will succeed if the TSource item at the parser's current position does not exist in values
| Name | Type | Description |
|---|---|---|
| values | System.Collections.Generic.IReadOnlyList{``0} | Item to compare |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
| Name | Description |
|---|---|
| System.ArgumentNullException | values is null |
Creates a Parser`2 that yields a single TSource item if it does not exist in values, using comparer to compare values
A Parser`2 that will succeed if the TSource item at the parser's current position does not exist in values
| Name | Type | Description |
|---|---|---|
| values | System.Collections.Generic.IReadOnlyList{``0} | Item to compare |
| comparer | System.Collections.Generic.IEqualityComparer{``0} | Comparer to use to determine equality between TSource items |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
| Name | Description |
|---|---|
| System.ArgumentException | values is empty |
| System.ArgumentNullException | values or comparer is null |
Creates a Parser`2 that yields a single TSource item if it does not equal value, using the default comparer for TSource to compare items
A parser that will succeed if the TSource item at the parser's current position does not equal value
| Name | Type | Description |
|---|---|---|
| value | ``0 | Item to match |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
Creates a Parser`2 that yields a single TSource item if it does not equal value, using comparer to compare items
A parser that will succeed if the TSource item at the parser's current position does not equal value
| Name | Type | Description |
|---|---|---|
| value | ``0 | Item to match |
| comparer | System.Collections.Generic.IEqualityComparer{``0} | Comparer used to determine equality between TSource items |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
| Name | Description |
|---|---|
| System.ArgumentNullException | comparer is null |
Creates a Parser`2 that yields a IReadOnlyList`1 if the sequence of items at the current position equals value, using the default comparer for TSource to compare items
A Parser`2 that will succeed if the sequence of TSource items at the parser's current position equals value
| Name | Type | Description |
|---|---|---|
| value | System.Collections.Generic.IReadOnlyList{``0} | ReadOnlyMemory`1 containing the sequence of TSource items to compare |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
Creates a Parser`2 that yields a IReadOnlyList`1 if the sequence of items at the current position equals value, using comparer to compare items
A Parser`2 that will succeed if the sequence of TSource items at the parser's current position equals value
| Name | Type | Description |
|---|---|---|
| value | System.Collections.Generic.IReadOnlyList{``0} | ReadOnlyMemory`1 containing the sequence of TSource items to compare |
| comparer | System.Collections.Generic.IEqualityComparer{``0} | Comparer used to determine equality between TSource items |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
| Name | Description |
|---|---|
| System.ArgumentException | value is empty |
| System.ArgumentNullException | value or comparer is null |
Creates a Parser`2 that yields a single TSource item if it equals value, using the default comparer for TSource to compare items
A parser that will succeed if the TSource item at the parser's current position equals value
| Name | Type | Description |
|---|---|---|
| value | ``0 | Item to match |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
Creates a Parser`2 that yields a single TSource item if it equals value, using the comparer to compare items.
A Parser`2 that will succeed if the TSource item at the parser's current position equals value
| Name | Type | Description |
|---|---|---|
| value | ``0 | Item to compare |
| comparer | System.Collections.Generic.IEqualityComparer{``0} | Comparer used to determine equality between TSource items |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
Creates a Parser`2 that yields the range of TSource items from the current parser until next succeeds
A [](#!-Parser<TSource, Tuple<Range, TNext>> 'Parser<TSource, Tuple<Range, TNext>>') that yields a tuple containing the Range that was matched and the result of next
| Name | Type | Description |
|---|---|---|
| next | Monda.Parser{``0,``1} | A Parser`2 that will succeed at the end of the range |
| min | System.Int32 | Minimum number of matches required (inclusive) |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
| TNext | The return type of the next parser |
| Name | Description |
|---|---|
| System.ArgumentNullException | next is null |
| System.ArgumentOutOfRangeException | min is less than 0 |
Creates a Parser`2 that yields the range of TSource items from the current parser position matching predicate
A Parser`2 that yields the Range of data that was matched
| Name | Type | Description |
|---|---|---|
| predicate | System.Func{``0,System.Boolean} | Predicate that is invoked for each TSource item |
| min | System.Int32 | Minimum number of matches required (inclusive) |
| max | System.Nullable{System.Int32} | Maximum number of matches allowed (inclusive) |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
| Name | Description |
|---|---|
| System.ArgumentNullException | predicate is null |
| System.ArgumentOutOfRangeException | min is less than 0 or max is less than min |
Creates a Parser`2 that yields the range of TSource items from the current parser position matching predicate
A Parser`2 that yields the Range of data that was matched
| Name | Type | Description |
|---|---|---|
| predicate | Monda.ParserPredicate{``0} | Predicate that is invoked for each TSource item |
| min | System.Int32 | Minimum number of matches required (inclusive) |
| max | System.Nullable{System.Int32} | Maximum number of matches allowed (inclusive) |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
| Name | Description |
|---|---|
| System.ArgumentNullException | predicate is null |
| System.ArgumentOutOfRangeException | min is less than 0 or max is less than min |
The ReadOnlySpan`1 passed to predicate is a slice starting at the parser's intial position and the index will increase from 0
Monda
Creates a new parser that ensures that the current parser is between left and right
A new Parser`2 that returns the result of the current parser if it is found between left and right
| Name | Type | Description |
|---|---|---|
| self | Monda.Parser{``0,``1} | The current parser |
| left | Monda.Parser{``0,``2} | The first parser to be executed |
| right | Monda.Parser{``0,``3} | The last parser to execute |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
| TResult | The result type of self |
| TLeft | The result type of left |
| TRight | The result type of right |
Create a new parser that ensures that the current parser is followed by next
A new Parser`2 that executes self and next in that order and returns the TResult from self
| Name | Type | Description |
|---|---|---|
| self | Monda.Parser{``0,``1} | The current parser |
| next | Monda.Parser{``0,``2} | The parser to execute after the current parser, its result will be discarded |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
| TResult | The result type of self |
| TNext | The result type of next |
Although the parsing position will be advanced accordingly, the result of next will be discarded. Use Then``3 if you need to capture the result
Create a new parser that executes the current parser until another parser succeeds, then aggregates and combines the results
A new Parser`2 that executes the current parser until next succeeds, aggregating and combining the results
| Name | Type | Description |
|---|---|---|
| self | Monda.Parser{``0,``1} | The current parser |
| next | Monda.Parser{``0,``2} | The parser that determines when to stop repeating |
| min | System.Int32 | The minimum number of times the parser must execute |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
| TResult | The result type of self |
| Name | Description |
|---|---|
| System.StackOverflowException | If the current parser returns a zero-length result |
- Monda.ParserExtensions.Repeat``2
- Monda.ParserExtensions.Many``2
- Monda.ParserExtensions.Skip``2
- Monda.ParserExtensions.SkipMany``2
- Monda.ParserExtensions.SkipUntil``3
Create a new parser that executes the current parser until failure or an upper bound is reached and aggregates the results
A new Parser`2 that executes the current parser between min and max times and aggregates the results
| Name | Type | Description |
|---|---|---|
| self | Monda.Parser{``0,``1} | The current parser |
| min | System.Int32 | The minimum number of times the parser must execute (inclusive) |
| max | System.Nullable{System.Int32} | The maximum number of times the parser can execute (inclusive). A null value indicates there is no upper bound |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
| TResult | The result type of self |
| Name | Description |
|---|---|
| System.StackOverflowException | If the current parser returns a zero-length result |
- Monda.ParserExtensions.Repeat``2
- Monda.ParserExtensions.ManyUntil``3
- Monda.ParserExtensions.Skip``2
- Monda.ParserExtensions.SkipMany``2
- Monda.ParserExtensions.SkipUntil``3
Create a new parser that maps the result of the current parser to a new value
A new Parser`2 that executes the current parser and maps the value to a new value
| Name | Type | Description |
|---|---|---|
| self | Monda.Parser{``0,``1} | The current parser |
| map | Monda.MapFunction{``0,``1,``2} | A function that maps the value from the current parser to a new value |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
| TResult | The result type of self |
| TNext | The mapped value type |
Create a parser that returns a zero-length default result if the current parser fails
A new Parser`2 that executes the current parser, returning its result when successful or a default zero-length result otherwise
| Name | Type | Description |
|---|---|---|
| self | Monda.Parser{``0,``1} | The current parser |
| defaultValue | ``1 | The default value to return if the current parser fails |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
| TResult | The result type of self |
Create a new parser that executes the current parser, or other if the current parser fails
A new Parser`2 that returns the first successful result of the current parser and other in that order
| Name | Type | Description |
|---|---|---|
| self | Monda.Parser{``0,``1} | The current parser |
| other | Monda.Parser{``0,``1} | The other parser to execute if the current one is fails |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
| TResult | The result type of self and other |
Create a new parser that ensures that the current parser is preceded by previous
A new Parser`2 that executes previous and self in that order and returns the TResult from self
| Name | Type | Description |
|---|---|---|
| self | Monda.Parser{``0,``1} | The current parser |
| previous | Monda.Parser{``0,``2} | The parser to execute before the current parser, its result will be discarded |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
| TResult | The result type of self |
| TPrevious | The result type of previous |
Although the parsing position will be advanced accordingly, the result of previous will be discarded. Use Then``3 if you need to capture the result
Create a new parser that executes the current parser a fixed number of times and aggregates the results
A new Parser`2 that executes the current parser count times and aggregates the results
| Name | Type | Description |
|---|---|---|
| self | Monda.Parser{``0,``1} | The current parser |
| count | System.Int32 | The number of times to repeat the current parser |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
| TResult | The result type of self |
| Name | Description |
|---|---|
| System.StackOverflowException | If the current parser returns a zero-length result |
- Monda.ParserExtensions.Skip``2
- Monda.ParserExtensions.Many``2
- Monda.ParserExtensions.ManyUntil``3
- Monda.ParserExtensions.SkipMany``2
- Monda.ParserExtensions.SkipUntil``3
Create a new parser that executes the current parser until failure or an upper bound is reached and counts the number of results
A new Parser`2 that executes the current parser between min and max times and counts the number results
| Name | Type | Description |
|---|---|---|
| self | Monda.Parser{``0,``1} | The current parser |
| min | System.Int32 | The minimum number of times the parser must execute (inclusive) |
| max | System.Nullable{System.Int32} | The maximum number of times the parser can execute (inclusive). A null value indicates there is no upper bound |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
| TResult | The result type of self |
| Name | Description |
|---|---|
| System.StackOverflowException | If the current parser returns a zero-length result |
- Monda.ParserExtensions.Repeat``2
- Monda.ParserExtensions.Many``2
- Monda.ParserExtensions.ManyUntil``3
- Monda.ParserExtensions.Skip``2
- Monda.ParserExtensions.SkipUntil``3
Create a new parser that executes the current parser until another parser succeeds, then counts and combines the results
A new Parser`2 that executes the current parser until next succeeds, counting and combining the results
| Name | Type | Description |
|---|---|---|
| self | Monda.Parser{``0,``1} | The current parser |
| next | Monda.Parser{``0,``2} | The parser that determines when to stop repeating |
| min | System.Int32 | The minimum number of times the parser must execute |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
| TResult | The result type of self |
| Name | Description |
|---|---|
| System.StackOverflowException | If the current parser returns a zero-length successful result |
- Monda.ParserExtensions.Repeat``2
- Monda.ParserExtensions.Many``2
- Monda.ParserExtensions.ManyUntil``3
- Monda.ParserExtensions.Skip``2
- Monda.ParserExtensions.SkipMany``2
Create a new parser that executes the current parser and next in order and combines the results
A new Parser`2 that executes self and next is sequence and returns a Tuple`2 of the results if both are successful
| Name | Type | Description |
|---|---|---|
| self | Monda.Parser{``0,``1} | The current parser |
| next | Monda.Parser{``0,``2} | The next Parser`2 |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
| TResult | The result type of the current parser |
| TNext | The result type of next |
Create a new parser that tries to map the result of the current parser to a new value
A new Parser`2 that executes the current parser and tries to map the value to a new value
| Name | Type | Description |
|---|---|---|
| self | Monda.Parser{``0,``1} | The current parser |
| tryMap | Monda.TryMapFunction{``0,``1,``2} | A function that tries to map the value from the current parser to a new value |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
| TResult | The result type of self |
| TNext | The mapped value type |
Monda
Predicate that tests the TSource item at the current index.
True if the TSource item at the current index is acceptable, false otherwise
| Name | Type | Description |
|---|---|---|
| data | T:Monda.ParserPredicate`1 | Input data to parse |
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
Monda
Fundamental parsing unit to extract one TResult output from a set of TSource input items
| Name | Description |
|---|---|
| TSource | The type of items in the input data |
| TResult | The result type of the parser |
Monda
Represents start and length properties that define a range in contiguous data