Class ParseError<TToken>
Represents an error encountered during parsing.
Inheritance
ParseError<TToken>
Assembly: Pidgin.dll
Syntax
public class ParseError<TToken> : IEquatable<ParseError<TToken>>
Type Parameters
Name |
Description |
TToken |
The type of tokens in the input stream
|
Properties
|
Improve this Doc
View Source
EOF
Was the parse error due to encountering the end of the input stream while parsing?
Declaration
Property Value
Type |
Description |
Boolean |
True if and only if the parse error was due to encountering the end of the input stream while parsing
|
|
Improve this Doc
View Source
ErrorPos
The position in the input stream at which the parse error occurred
Declaration
public SourcePos ErrorPos { get; }
Property Value
Type |
Description |
SourcePos |
The position in the input stream at which the parse error occurred
|
|
Improve this Doc
View Source
Expected
A collection of expected inputs
Declaration
public IEnumerable<Expected<TToken>> Expected { get; }
Property Value
Type |
Description |
IEnumerable<Expected<TToken>> |
The collection of expected inputs
|
|
Improve this Doc
View Source
Message
Declaration
public string Message { get; }
Property Value
Type |
Description |
String |
A custom error message, or null if the error was created without a custom error message
|
|
Improve this Doc
View Source
Unexpected
The token which caused the parse error.
Declaration
public Maybe<TToken> Unexpected { get; }
Property Value
Type |
Description |
Maybe<TToken> |
The token which caused the parse error, or Nothing<T>() if the parse error was not caused by an unexpected token.
|
Methods
|
Improve this Doc
View Source
Equals(ParseError<TToken>)
Declaration
public bool Equals(ParseError<TToken> other)
Parameters
Returns
|
Improve this Doc
View Source
Equals(Object)
Declaration
public override bool Equals(object other)
Parameters
Type |
Name |
Description |
Object |
other |
|
Returns
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
|
Improve this Doc
View Source
RenderErrorMessage()
Render the parse error as a string
Declaration
public string RenderErrorMessage()
Returns
Type |
Description |
String |
An error message
|
|
Improve this Doc
View Source
ToString()
Render the parse error as a string
Declaration
public override string ToString()
Returns
Type |
Description |
String |
An error message
|
Operators
|
Improve this Doc
View Source
Equality(ParseError<TToken>, ParseError<TToken>)
Declaration
public static bool operator ==(ParseError<TToken> left, ParseError<TToken> right)
Parameters
Returns
|
Improve this Doc
View Source
Inequality(ParseError<TToken>, ParseError<TToken>)
Declaration
public static bool operator !=(ParseError<TToken> left, ParseError<TToken> right)
Parameters
Returns