Table of Contents

Class Parenthesis

Namespace
Utils.Expressions
Assembly
Utils.dll

Describes a set of parenthesis tokens used by the expression parser.

public record Parenthesis : IEquatable<Parenthesis>
Inheritance
Parenthesis
Implements
Inherited Members
Extension Methods

Constructors

Parenthesis(string, string, string)

Describes a set of parenthesis tokens used by the expression parser.

public Parenthesis(string Start, string End, string Separator = null)

Parameters

Start string

Token that opens the group.

End string

Token that closes the group.

Separator string

Optional separator token used between arguments.

Properties

End

Token that closes the group.

public string End { get; init; }

Property Value

string

Separator

Optional separator token used between arguments.

public string Separator { get; init; }

Property Value

string

Start

Token that opens the group.

public string Start { get; init; }

Property Value

string

Methods

Test(string, bool, out bool)

Tests a token while optionally ignoring the separator.

public bool Test(string token, bool ignoreSeparator, out bool isEnd)

Parameters

token string

Token to test.

ignoreSeparator bool

When true, separator tokens are ignored.

isEnd bool

Set to true if the token is the closing token.

Returns

bool

true if the token matches.

Test(string, out bool)

Tests whether a token represents the end or separator of the parenthesis set.

public bool Test(string token, out bool isEnd)

Parameters

token string

Token to test.

isEnd bool

Set to true if the token is the closing token.

Returns

bool

true if the token matches one of the markers.

Operators

implicit operator Parenthesis((string Start, string End, string Separator))

Creates a Parenthesis from a tuple including a separator.

public static implicit operator Parenthesis((string Start, string End, string Separator) value)

Parameters

value (string Start, string End, string Separator)

Returns

Parenthesis

implicit operator Parenthesis((string Start, string End))

Creates a Parenthesis from a tuple of start and end tokens.

public static implicit operator Parenthesis((string Start, string End) value)

Parameters

value (string Start, string End)

Returns

Parenthesis