Class ParserApplicationException
- Namespace
- Farkle
- Assembly
- Farkle.dll
Represents an application-specific error that occurred during parsing.
public sealed class ParserApplicationException : Exception, ISerializable
- Inheritance
-
ParserApplicationException
- Implements
- Inherited Members
Remarks
Farkle will catch this exception when thrown from a semantic provider or tokenizer, and gracefully fail the parsing process with a user-specified error object.
Constructors
ParserApplicationException(object, bool)
Creates a ParserApplicationException.
public ParserApplicationException(object error, bool autoSetPosition = true)
Parameters
error
objectThe error object that will be returned to the parser.
autoSetPosition
boolWhether the parser's position should be included in the error object. Defaults to true.
Properties
AutoSetPosition
Whether the parser's position should be included in the error object.
public bool AutoSetPosition { get; }
Property Value
Remarks
If set to true, Farkle will wrap Error in a ParserDiagnostic with the parser's CurrentPosition at the time of the error, and return it to the user.
This property is ignored if Error is already a ParserDiagnostic.
Error
The error object that will be returned from the parser.
public object Error { get; }
Property Value
Message
Returns the message of the ParserApplicationException. It is the string representation of the Error property.
public override string Message { get; }