Struct Production
Represents a production of a Grammar.
public readonly struct Production : IEquatable<Production>
- Implements
Remarks
A production is a rule of the form A ::= b
, where A
(the Head) is a Nonterminal
and b (the Members) is a possibly empty sequence of terminals or nonterminals such that when the right-hand
side symbols are encountered, they can derive and be substituted by the left-hand side symbol.
Properties
Handle
The Production's ProductionHandle.
public ProductionHandle Handle { get; }
Property Value
Remarks
In earlier versions of Farkle the Handle
property referred
to the property that is now called Members.
Head
The nonterminal on the Production's left-hand side.
public Nonterminal Head { get; }
Property Value
Members
The terminals or nonterminals on the Production's right-hand side.
public ProductionMemberList Members { get; }
Property Value
Methods
Equals(Production)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Production other)
Parameters
other
ProductionAn 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 Production.
public override string ToString()
Returns
Operators
operator ==(Production, Production)
Compares two Productions for equality.
public static bool operator ==(Production left, Production right)
Parameters
left
ProductionThe first production.
right
ProductionThe second production.
Returns
operator !=(Production, Production)
Compares two Productions for inequality.
public static bool operator !=(Production left, Production right)
Parameters
left
ProductionThe first production.
right
ProductionThe second production.