Table of Contents

Class GroupingExpression<T>

Namespace
RandomizerCore.StringParsing
Assembly
RandomizerCore.dll

A parenthesized nested expression.

public record GroupingExpression<T> : IExpression<T>, IEquatable<GroupingExpression<T>>

Type Parameters

T
Inheritance
GroupingExpression<T>
Implements
Inherited Members

Constructors

GroupingExpression(StructuralToken, IExpression<T>, StructuralToken)

A parenthesized nested expression.

public GroupingExpression(StructuralToken OpenParenthesis, IExpression<T> Nested, StructuralToken CloseParenthesis)

Parameters

OpenParenthesis StructuralToken

The open parenthesis token

Nested IExpression<T>

The nested expression

CloseParenthesis StructuralToken

The close parenthesis token

Properties

CloseParenthesis

The close parenthesis token

public StructuralToken CloseParenthesis { get; init; }

Property Value

StructuralToken

EndChar

public int EndChar { get; }

Property Value

int

Nested

The nested expression

public IExpression<T> Nested { get; init; }

Property Value

IExpression<T>

OpenParenthesis

The open parenthesis token

public StructuralToken OpenParenthesis { get; init; }

Property Value

StructuralToken

StartChar

public int StartChar { get; }

Property Value

int

Methods

Evaluate()

Speculates possible types for an expression. If the result { T.A, T.B } is returned, then the result is to be interpreted as "A or B".

public IEnumerable<T> Evaluate()

Returns

IEnumerable<T>

Print()

Reconstructs the original string representation of the expression

public string Print()

Returns

string

Validate(ExpressionValidator<T>)

Validates whether the expression is structurally and semantically valid and aggregates any errors using the provided expression validator.

public bool Validate(ExpressionValidator<T> validator)

Parameters

validator ExpressionValidator<T>

The validator to use to aggregate errors.

Returns

bool

Whether the expression is valid or not.