Struct Nonterminal
Represents a nonterminal of a Grammar.
public readonly struct Nonterminal : IEquatable<Nonterminal>
- 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
The Nonterminal's NonterminalAttributes.
public NonterminalAttributes Attributes { get; }
Property Value
Handle
The Nonterminal's NonterminalHandle.
public NonterminalHandle Handle { get; }
Property Value
Name
The Nonterminal's name.
public string Name { get; }
Property Value
Productions
The Productions that have this Nonterminal as their Head.
public ProductionCollection Productions { get; }
Property Value
Methods
Equals(Nonterminal)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Nonterminal other)
Parameters
other
NonterminalAn 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
obj
objectThe 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 Nonterminal.
public override string ToString()
Returns
Operators
operator ==(Nonterminal, Nonterminal)
Compares two Nonterminals for equality.
public static bool operator ==(Nonterminal left, Nonterminal right)
Parameters
left
NonterminalThe first nonterminal.
right
NonterminalThe second nonterminal.
Returns
operator !=(Nonterminal, Nonterminal)
Compares two Nonterminals for inequality.
public static bool operator !=(Nonterminal left, Nonterminal right)
Parameters
left
NonterminalThe first nonterminal.
right
NonterminalThe second nonterminal.