Table of Contents

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)

public ParserApplicationException(object error, bool autoSetPosition = true)

Parameters

error object

The error object that will be returned to the parser.

autoSetPosition bool

Whether 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

bool

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

object

Message

Returns the message of the ParserApplicationException. It is the string representation of the Error property.

public override string Message { get; }

Property Value

string