Struct 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
)
Assembly: Pidgin.dll
Syntax
public struct Expected<TToken> : IEquatable<Expected<TToken>>, IComparable<Expected<TToken>>
Type Parameters
Properties
|
Improve this Doc
View Source
IsEof
Did the parser expect the end of the input stream?
Declaration
public bool IsEof { get; }
Property Value
Type |
Description |
Boolean |
True if the parser expected the end of the input stream
|
|
Improve this Doc
View Source
Label
The custom name of the parser that produced this error, or null if the expectation was a sequence of tokens.
Declaration
public string? Label { get; }
Property Value
|
Improve this Doc
View Source
Tokens
The sequence of tokens that were expected at the point of the error, null if the parser had a custom name.
Declaration
public IEnumerable<TToken>? Tokens { get; }
Property Value
Type |
Description |
Nullable<IEnumerable<TToken>> |
The sequence of tokens that were expected
|
Methods
|
Improve this Doc
View Source
CompareTo(Expected<TToken>)
Declaration
public int CompareTo(Expected<TToken> other)
Parameters
Type |
Name |
Description |
Expected<TToken> |
other |
|
Returns
|
Improve this Doc
View Source
Equals(Expected<TToken>)
Declaration
public bool Equals(Expected<TToken> other)
Parameters
Type |
Name |
Description |
Expected<TToken> |
other |
|
Returns
|
Improve this Doc
View Source
Equals(Nullable<Object>)
Declaration
public override bool Equals(object? other)
Parameters
Returns
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
|
Improve this Doc
View Source
ToString()
Declaration
public override string ToString()
Returns
Operators
|
Improve this Doc
View Source
Equality(Expected<TToken>, Expected<TToken>)
Declaration
public static bool operator ==(Expected<TToken> left, Expected<TToken> right)
Parameters
Returns
|
Improve this Doc
View Source
GreaterThan(Expected<TToken>, Expected<TToken>)
Declaration
public static bool operator>(Expected<TToken> left, Expected<TToken> right)
Parameters
Returns
|
Improve this Doc
View Source
GreaterThanOrEqual(Expected<TToken>, Expected<TToken>)
Declaration
public static bool operator >=(Expected<TToken> left, Expected<TToken> right)
Parameters
Returns
|
Improve this Doc
View Source
Inequality(Expected<TToken>, Expected<TToken>)
Declaration
public static bool operator !=(Expected<TToken> left, Expected<TToken> right)
Parameters
Returns
|
Improve this Doc
View Source
LessThan(Expected<TToken>, Expected<TToken>)
Declaration
public static bool operator <(Expected<TToken> left, Expected<TToken> right)
Parameters
Returns
|
Improve this Doc
View Source
LessThanOrEqual(Expected<TToken>, Expected<TToken>)
Declaration
public static bool operator <=(Expected<TToken> left, Expected<TToken> right)
Parameters
Returns
Implements
IEquatable<>
IComparable<>