Show / Hide Table of Contents

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)

Implements
IEquatable<Expected<TToken>>
IComparable<Expected<TToken>>
Namespace: Pidgin
Assembly: Pidgin.dll
Syntax
public struct Expected<TToken> : IEquatable<Expected<TToken>>, IComparable<Expected<TToken>>
Type Parameters
Name Description
TToken

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
Type Description
Nullable<String>

The label

| 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
Type Description
Int32
| Improve this Doc View Source

Equals(Expected<TToken>)

Declaration
public bool Equals(Expected<TToken> other)
Parameters
Type Name Description
Expected<TToken> other
Returns
Type Description
Boolean
| Improve this Doc View Source

Equals(Nullable<Object>)

Declaration
public override bool Equals(object? other)
Parameters
Type Name Description
Nullable<Object> other
Returns
Type Description
Boolean
| Improve this Doc View Source

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
Int32
| Improve this Doc View Source

ToString()

Declaration
public override string ToString()
Returns
Type Description
String

Operators

| Improve this Doc View Source

Equality(Expected<TToken>, Expected<TToken>)

Declaration
public static bool operator ==(Expected<TToken> left, Expected<TToken> right)
Parameters
Type Name Description
Expected<TToken> left
Expected<TToken> right
Returns
Type Description
Boolean
| Improve this Doc View Source

GreaterThan(Expected<TToken>, Expected<TToken>)

Declaration
public static bool operator>(Expected<TToken> left, Expected<TToken> right)
Parameters
Type Name Description
Expected<TToken> left
Expected<TToken> right
Returns
Type Description
Boolean
| Improve this Doc View Source

GreaterThanOrEqual(Expected<TToken>, Expected<TToken>)

Declaration
public static bool operator >=(Expected<TToken> left, Expected<TToken> right)
Parameters
Type Name Description
Expected<TToken> left
Expected<TToken> right
Returns
Type Description
Boolean
| Improve this Doc View Source

Inequality(Expected<TToken>, Expected<TToken>)

Declaration
public static bool operator !=(Expected<TToken> left, Expected<TToken> right)
Parameters
Type Name Description
Expected<TToken> left
Expected<TToken> right
Returns
Type Description
Boolean
| Improve this Doc View Source

LessThan(Expected<TToken>, Expected<TToken>)

Declaration
public static bool operator <(Expected<TToken> left, Expected<TToken> right)
Parameters
Type Name Description
Expected<TToken> left
Expected<TToken> right
Returns
Type Description
Boolean
| Improve this Doc View Source

LessThanOrEqual(Expected<TToken>, Expected<TToken>)

Declaration
public static bool operator <=(Expected<TToken> left, Expected<TToken> right)
Parameters
Type Name Description
Expected<TToken> left
Expected<TToken> right
Returns
Type Description
Boolean

Implements

IEquatable<>
IComparable<>
  • Improve this Doc
  • View Source
Back to top Generated by DocFX