Struct NonterminalDefinition
Provides information about a nonterminal of a Grammar.
public readonly struct NonterminalDefinition : IEquatable<NonterminalDefinition>
- Implements
Remarks
A nonterminal is a composite symbol that can be derived from a sequence of terminals and other nonterminals, as specified by its Productions.
Properties
Attributes
public NonterminalAttributes Attributes { get; }
Property Value
Handle
public NonterminalHandle Handle { get; }
Property Value
Name
The NonterminalDefinition's name.
public string Name { get; }
Property Value
Productions
The ProductionDefinitions that have this NonterminalDefinition as their Head.
public ProductionDefinitionCollection Productions { get; }
Property Value
Methods
Equals(NonterminalDefinition)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(NonterminalDefinition other)
Parameters
otherNonterminalDefinitionAn 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 NonterminalDefinition.
public override string ToString()
Returns
Operators
operator ==(NonterminalDefinition, NonterminalDefinition)
Compares two NonterminalDefinitions for equality.
public static bool operator ==(NonterminalDefinition left, NonterminalDefinition right)
Parameters
leftNonterminalDefinitionThe first nonterminal.
rightNonterminalDefinitionThe second nonterminal.
Returns
operator !=(NonterminalDefinition, NonterminalDefinition)
Compares two NonterminalDefinitions for inequality.
public static bool operator !=(NonterminalDefinition left, NonterminalDefinition right)
Parameters
leftNonterminalDefinitionThe first nonterminal.
rightNonterminalDefinitionThe second nonterminal.