Table of Contents

Class ItemAtomExpression

Namespace
RandomizerCore.StringItems
Assembly
RandomizerCore.dll
public record ItemAtomExpression : IExpression<ItemExpressionType>, IEquatable<ItemAtomExpression>
Inheritance
ItemAtomExpression
Implements
Inherited Members

Constructors

ItemAtomExpression(Token)

public ItemAtomExpression(Token Token)

Parameters

Token Token

Properties

EndChar

public int EndChar { get; }

Property Value

int

StartChar

public int StartChar { get; }

Property Value

int

Token

public Token Token { get; init; }

Property Value

Token

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<ItemExpressionType> Evaluate()

Returns

IEnumerable<ItemExpressionType>

IsAtomToken(Token)

public static bool IsAtomToken(Token token)

Parameters

token Token

Returns

bool

Print()

Reconstructs the original string representation of the expression

public string Print()

Returns

string

Validate(ExpressionValidator<ItemExpressionType>)

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

public bool Validate(ExpressionValidator<ItemExpressionType> validator)

Parameters

validator ExpressionValidator<ItemExpressionType>

The validator to use to aggregate errors.

Returns

bool

Whether the expression is valid or not.