Table of Contents

Struct NonterminalDefinition

Namespace
Farkle.Grammars
Assembly
Farkle.dll

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

NonterminalAttributes

Handle

public NonterminalHandle Handle { get; }

Property Value

NonterminalHandle

Name

public string Name { get; }

Property Value

string

Productions

The ProductionDefinitions that have this NonterminalDefinition as their Head.

public ProductionDefinitionCollection Productions { get; }

Property Value

ProductionDefinitionCollection

Methods

Equals(NonterminalDefinition)

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

public bool Equals(NonterminalDefinition other)

Parameters

other NonterminalDefinition

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

public override string ToString()

Returns

string

Operators

operator ==(NonterminalDefinition, NonterminalDefinition)

Compares two NonterminalDefinitions for equality.

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

Parameters

left NonterminalDefinition

The first nonterminal.

right NonterminalDefinition

The second nonterminal.

Returns

bool

operator !=(NonterminalDefinition, NonterminalDefinition)

Compares two NonterminalDefinitions for inequality.

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

Parameters

left NonterminalDefinition

The first nonterminal.

right NonterminalDefinition

The second nonterminal.

Returns

bool