Automata Docs Automata Docs
Automata Docs Automata Docs

Search Results for

    Edit this page

    Struct Transition

    Represents a (symbolic) transition in an automaton, defined by a starting state, a symbol, and an ending state.

    Implements
    IComparable<Transition>
    IEquatable<Transition>
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Automata.Core
    Assembly: Automata.Core.dll
    Syntax
    public readonly record struct Transition : IComparable<Transition>, IEquatable<Transition>
    Remarks

    A Transition always has a (non-epsilon) symbol and cannot represent an epsilon transition

    Constructors

    | Edit this page View Source

    Transition(int, int, int)

    Initializes a new instance of the Transition struct.

    Declaration
    public Transition(int fromState, int symbol, int toState)
    Parameters
    Type Name Description
    int fromState

    The state origin of the transition.

    int symbol

    The symbol for the transition.

    int toState

    The destination state of the transition.

    Exceptions
    Type Condition
    ArgumentException

    Thrown if any of arguments has a negative value.

    Properties

    | Edit this page View Source

    FromState

    The state origin of the transition.

    Declaration
    public int FromState { get; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    Invalid

    Invalid transition.

    Declaration
    public static Transition Invalid { get; }
    Property Value
    Type Description
    Transition
    | Edit this page View Source

    IsInvalid

    Indicates whether the transition is invalid.

    Declaration
    public bool IsInvalid { get; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    Symbol

    Symbol for the transition.

    Declaration
    public int Symbol { get; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    ToState

    The destination state of the transition.

    Declaration
    public int ToState { get; }
    Property Value
    Type Description
    int

    Methods

    | Edit this page View Source

    CompareTo(Transition)

    Compares the current transition to another transition by default order: {FromState, Symbol, ToState}.

    Declaration
    public int CompareTo(Transition other)
    Parameters
    Type Name Description
    Transition other

    Other transition to compare to.

    Returns
    Type Description
    int

    An integer that indicates the relative order of the objects being compared.

    | Edit this page View Source

    ComparerByToState()

    A comparer that compares transitions by their to states.

    Declaration
    public static Comparer<Transition> ComparerByToState()
    Returns
    Type Description
    Comparer<Transition>

    A comparer that compares transitions in reversed order: {ToState, Symbol, FromState}.

    | Edit this page View Source

    Reverse()

    Reverses the transition.

    Declaration
    public Transition Reverse()
    Returns
    Type Description
    Transition

    A new Transition with the from and to states swapped.

    | Edit this page View Source

    ToString()

    String that represents the current transition.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A string that represents the current transition.

    Overrides
    ValueType.ToString()

    Implements

    IComparable<T>
    IEquatable<T>