Table of Contents

Struct Group

Namespace
Farkle.Grammars
Assembly
Farkle.dll

Represents a group in a Grammar.

public readonly struct Group : IEquatable<Group>
Implements

Remarks

Groups are lexical constructs that begin and end with specific token symbols, contain arbitrary text or nested groups and are contained in one token symbol.

A typical use of groups is in implementing comments.

Properties

Attributes

public GroupAttributes Attributes { get; }

Property Value

GroupAttributes

Container

The token symbol that represents the Group's content.

public TokenSymbol Container { get; }

Property Value

TokenSymbol

End

The token symbol that ends this Group.

public TokenSymbol End { get; }

Property Value

TokenSymbol

Name

The Group's name.

public string Name { get; }

Property Value

string

Nesting

A collection of the Groups that can be nested inside this Group.

public GroupNestingCollection Nesting { get; }

Property Value

GroupNestingCollection

Start

The token symbol that starts this Group.

public TokenSymbol Start { get; }

Property Value

TokenSymbol

Methods

Equals(Group)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(Group other)

Parameters

other Group

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

ToString()

Returns a string describing the Group.

public override string ToString()

Returns

string

Operators

operator ==(Group, Group)

Compares two Groups for equality.

public static bool operator ==(Group left, Group right)

Parameters

left Group

The first group.

right Group

The second group.

Returns

bool

operator !=(Group, Group)

Compares two Groups for inequality.

public static bool operator !=(Group left, Group right)

Parameters

left Group

The first group.

right Group

The second group.

Returns

bool