Table of Contents

Struct ParserCompletionState<T>

Namespace
Farkle.Parser
Assembly
Farkle.dll

Tracks whether a parsing operation has completed and its result.

public struct ParserCompletionState<T>

Type Parameters

T

The type of values the parsing operation returns in case of success.

Inherited Members

Remarks

This is a mutable value type that must be passed around by reference.

Properties

IsCompleted

Whether the parsing operation has completed.

public readonly bool IsCompleted { get; }

Property Value

bool
See Also

Result

The result of the parsing operation.

public readonly ParserResult<T> Result { get; }

Property Value

ParserResult<T>

Exceptions

InvalidOperationException

IsCompleted is false.

Methods

SetError(object)

Fails a parsing operation.

public void SetError(object error)

Parameters

error object

The error value.

SetResult(ParserResult<T>)

Completes a parsing operation.

public void SetResult(ParserResult<T> result)

Parameters

result ParserResult<T>

The value that will be assigned to Result.

Exceptions

InvalidOperationException

The parsing operation has already been set as completed.

SetSuccess(T)

Successfully completes a parsing operation.

public void SetSuccess(T value)

Parameters

value T

The success value.