Table of Contents

Struct GroupDefinition

Namespace
Farkle.Grammars
Assembly
Farkle.dll

Provides information about a group in a Grammar.

public readonly struct GroupDefinition : IEquatable<GroupDefinition>
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 GroupDefinition's content.

public TokenSymbolDefinition Container { get; }

Property Value

TokenSymbolDefinition

End

The token symbol that ends this GroupDefinition.

public TokenSymbolDefinition End { get; }

Property Value

TokenSymbolDefinition

Handle

public GroupHandle Handle { get; }

Property Value

GroupHandle

Name

The GroupDefinition's name.

public string Name { get; }

Property Value

string

Nesting

A collection of the GroupDefinitions that can be nested inside this GroupDefinition.

public GroupNestingCollection Nesting { get; }

Property Value

GroupNestingCollection

Start

The token symbol that starts this GroupDefinition.

public TokenSymbolDefinition Start { get; }

Property Value

TokenSymbolDefinition

Methods

Equals(GroupDefinition)

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

public bool Equals(GroupDefinition other)

Parameters

other GroupDefinition

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 GroupDefinition.

public override string ToString()

Returns

string

Operators

operator ==(GroupDefinition, GroupDefinition)

Compares two GroupDefinitions for equality.

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

Parameters

left GroupDefinition

The first group.

right GroupDefinition

The second group.

Returns

bool

operator !=(GroupDefinition, GroupDefinition)

Compares two GroupDefinitions for inequality.

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

Parameters

left GroupDefinition

The first group.

right GroupDefinition

The second group.

Returns

bool