Pidgin

Namespace Pidgin

Classes

Expected<TToken>

Represents a parsing expectation for error reporting. Expected values are either a sequence of expected tokens (in which case Label == null && Tokens != null), a custom-named parser (Label != null && Tokens == null), or the end of the input stream (Label == null && Tokens == null)

Maybe

Constructor functions, extension methods and utilities for working with Maybe<T>

Maybe<T>

Represents a single possibly absent value. Like Nullable but works for reference types as well as value types.

ParseError<TToken>

Represents an error encountered during parsing.

ParseException

Thrown when a parse error is encountered during parsing

Parser

Constructor functions, extension methods and utilities for Parser<TToken, T>. This class is intended to be imported statically ("using static Pidgin.Parser").

Parser<TToken>

Constructor functions, extension methods and utilities for Parser<TToken, T> This class is intended to be imported statically, with the type parameter set to the type of tokens in your input stream ("using static Pidgin.Parser<char>").

Parser<TToken, T>

Represents a parser which consumes a stream of values of type TToken and returns a value of type T. A parser can either succeed, and return a value of type T, or fail and return a ParseError<TToken>.

ParserExtensions

Extension methods for running parsers

ParseState<TToken>

Represents the state of a parsing process. Includes functionality managing and buffering the input stream, reporting errors, and computing source positions.

For efficiency, this object is implemented as a mutable struct and is intended to be passed by reference.

WARNING: This API is unstable and subject to change in future versions of the library.

PooledList<T>

A version of List<T> which uses an array pool.

For efficiency, PooledList<T> is implemented as a mutable struct. It's intended to be passed by reference.

ReadOnlySpanFunc<T, TParam, TReturn>

A function which computes a result from a ReadOnlySpan<T> and an additional argument.

Result<TToken, T>

Represents the result of parsing. A parse result may be successful (Success == true), in which case it contains a value, or it may be a failure, in which case it contains an error

SourcePos

Represents a (line, col) position in an input stream

SourcePosDelta

Represents a difference in textual lines and columns corresponding to a region of an input stream.

Unit

An uninteresting type with only one value (Value) and no fields. Like void, but valid as a type parameter

Interfaces

ITokenStream<TToken>

An interface for streams of TToken, which can be consumed by Parser<TToken, T>s.