Struct DfaEdge<TChar>
- Namespace
- Farkle.Grammars.StateMachines
- Assembly
- Farkle.dll
Maps a range of characters to a target DFA state.
public readonly struct DfaEdge<TChar> : IEquatable<DfaEdge<TChar>>
Type Parameters
- Implements
-
IEquatable<DfaEdge<TChar>>
- Inherited Members
Constructors
DfaEdge(TChar, TChar, int)
Maps a range of characters to a target DFA state.
public DfaEdge(TChar keyFrom, TChar keyTo, int target)
Parameters
Properties
KeyFrom
The first character in the range, inclusive.
public TChar KeyFrom { get; }
Property Value
- TChar
KeyTo
The last character in the range, inclusive.
public TChar KeyTo { get; }
Property Value
- TChar
Target
The index of the target DFA state, starting from 0.
public int Target { get; }
Property Value
Remarks
A negative value indicates that following this edge should stop the tokenizer.
Methods
Equals(DfaEdge<TChar>)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(DfaEdge<TChar> other)
Parameters
other
DfaEdge<TChar>An 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.
Operators
operator ==(DfaEdge<TChar>, DfaEdge<TChar>)
Checks two DfaEdge<TChar>s for equality.
public static bool operator ==(DfaEdge<TChar> left, DfaEdge<TChar> right)
Parameters
Returns
operator !=(DfaEdge<TChar>, DfaEdge<TChar>)
Checks two DfaEdge<TChar>s for inequality.
public static bool operator !=(DfaEdge<TChar> left, DfaEdge<TChar> right)