Table of Contents

Struct TokenSymbolDefinition

Namespace
Farkle.Grammars
Assembly
Farkle.dll

Provides information about a token symbol in a Grammar.

public readonly struct TokenSymbolDefinition : IEquatable<TokenSymbolDefinition>
Implements

Remarks

Token symbols are produced by tokenizers, usually powered by a DFA.

Properties

Attributes

The token symbol's TokenSymbolAttributes.

public TokenSymbolAttributes Attributes { get; }

Property Value

TokenSymbolAttributes

Handle

public TokenSymbolHandle Handle { get; }

Property Value

TokenSymbolHandle

Name

public string Name { get; }

Property Value

string

Methods

Equals(TokenSymbolDefinition)

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

public bool Equals(TokenSymbolDefinition other)

Parameters

other TokenSymbolDefinition

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

public override string ToString()

Returns

string

Operators

operator ==(TokenSymbolDefinition, TokenSymbolDefinition)

Compares two TokenSymbolDefinitions for equality.

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

Parameters

left TokenSymbolDefinition

The first token symbol.

right TokenSymbolDefinition

The second token symbol.

Returns

bool

operator !=(TokenSymbolDefinition, TokenSymbolDefinition)

Compares two TokenSymbolDefinitions for inequality.

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

Parameters

left TokenSymbolDefinition

The first token symbol.

right TokenSymbolDefinition

The second token symbol.

Returns

bool

See Also