Table of Contents

Struct Production

Namespace
Farkle.Grammars
Assembly
Farkle.dll

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

public ProductionHandle Handle { get; }

Property Value

ProductionHandle

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

Nonterminal

Members

The terminals or nonterminals on the Production's right-hand side.

public ProductionMemberList Members { get; }

Property Value

ProductionMemberList

Methods

Equals(Production)

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

public bool Equals(Production other)

Parameters

other Production

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

public override string ToString()

Returns

string

Operators

operator ==(Production, Production)

Compares two Productions for equality.

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

Parameters

left Production

The first production.

right Production

The second production.

Returns

bool

operator !=(Production, Production)

Compares two Productions for inequality.

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

Parameters

left Production

The first production.

right Production

The second production.

Returns

bool

See Also