Struct GroupDefinition
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
The GroupDefinition's GroupAttributes.
public GroupAttributes Attributes { get; }
Property Value
Container
The token symbol that represents the GroupDefinition's content.
public TokenSymbolDefinition Container { get; }
Property Value
End
The token symbol that ends this GroupDefinition.
public TokenSymbolDefinition End { get; }
Property Value
Handle
The GroupDefinition's GroupHandle.
public GroupHandle Handle { get; }
Property Value
Name
The GroupDefinition's name.
public string Name { get; }
Property Value
Nesting
A collection of the GroupDefinitions that can be nested inside this GroupDefinition.
public GroupNestingCollection Nesting { get; }
Property Value
Start
The token symbol that starts this GroupDefinition.
public TokenSymbolDefinition Start { get; }
Property Value
Methods
Equals(GroupDefinition)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(GroupDefinition other)
Parameters
otherGroupDefinitionAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand 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
Operators
operator ==(GroupDefinition, GroupDefinition)
Compares two GroupDefinitions for equality.
public static bool operator ==(GroupDefinition left, GroupDefinition right)
Parameters
leftGroupDefinitionThe first group.
rightGroupDefinitionThe second group.
Returns
operator !=(GroupDefinition, GroupDefinition)
Compares two GroupDefinitions for inequality.
public static bool operator !=(GroupDefinition left, GroupDefinition right)
Parameters
leftGroupDefinitionThe first group.
rightGroupDefinitionThe second group.