Search Results for

    Show / Hide Table of Contents

    Struct SwitchCase

    A case in switch flow.

    Implements
    IEquatable<SwitchCase>
    Inherited Members
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Flame.Compiler.Flow
    Assembly: Flame.Compiler.dll
    Syntax
    public struct SwitchCase : IEquatable<SwitchCase>

    Constructors

    | Edit this page View Source

    SwitchCase(Constant, Branch)

    Creates a switch case from a value and a branch.

    Declaration
    public SwitchCase(Constant value, Branch branch)
    Parameters
    Type Name Description
    Constant value

    The value for the switch case.

    Branch branch

    A branch for the switch case.

    | Edit this page View Source

    SwitchCase(ImmutableHashSet<Constant>, Branch)

    Creates a switch case from a set of values and a branch.

    Declaration
    public SwitchCase(ImmutableHashSet<Constant> values, Branch branch)
    Parameters
    Type Name Description
    ImmutableHashSet<Constant> values

    A set of values for the switch case.

    Branch branch

    A branch for the switch case.

    Properties

    | Edit this page View Source

    Branch

    Gets the branch that is taken when any of the values in this switch case match the value being switched on.

    Declaration
    public readonly Branch Branch { get; }
    Property Value
    Type Description
    Branch

    The switch case's branch.

    | Edit this page View Source

    Values

    Gets a set of all values for this switch case. If control reaches this switch case and any of these values match the value being switched on, then control is redirected to this switch case's branch target.

    Declaration
    public readonly ImmutableHashSet<Constant> Values { get; }
    Property Value
    Type Description
    ImmutableHashSet<Constant>

    The switch case's values.

    Methods

    | Edit this page View Source

    Equals(SwitchCase)

    Tests if this switch case equals another switch case.

    Declaration
    public bool Equals(SwitchCase other)
    Parameters
    Type Name Description
    SwitchCase other

    A switch case to compare with this switch case.

    Returns
    Type Description
    bool

    true if the switch cases are equal; otherwise, false.

    | Edit this page View Source

    Equals(object)

    Indicates whether this instance and a specified object are equal.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj

    The object to compare with the current instance.

    Returns
    Type Description
    bool

    true if obj and this instance are the same type and represent the same value; otherwise, false.

    Overrides
    ValueType.Equals(object)
    | Edit this page View Source

    GetHashCode()

    Returns the hash code for this instance.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A 32-bit signed integer that is the hash code for this instance.

    Overrides
    ValueType.GetHashCode()

    Operators

    | Edit this page View Source

    operator ==(SwitchCase, SwitchCase)

    Tests if two switch cases are equal.

    Declaration
    public static bool operator ==(SwitchCase left, SwitchCase right)
    Parameters
    Type Name Description
    SwitchCase left

    The first switch cases to compare.

    SwitchCase right

    The second switch cases to compare.

    Returns
    Type Description
    bool

    true if the switch cases are equal; otherwise, false.

    | Edit this page View Source

    operator !=(SwitchCase, SwitchCase)

    Tests if two switch cases are not equal.

    Declaration
    public static bool operator !=(SwitchCase left, SwitchCase right)
    Parameters
    Type Name Description
    SwitchCase left

    The first switch cases to compare.

    SwitchCase right

    The second switch cases to compare.

    Returns
    Type Description
    bool

    false if the switch cases are equal; otherwise, true.

    Implements

    IEquatable<T>
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX