Show / Hide Table of Contents

    Struct SwitchCase

    A case in switch flow.

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

    Constructors

    | Improve this Doc 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.

    | Improve this Doc 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
    System.Collections.Immutable.ImmutableHashSet<Constant> values

    A set of values for the switch case.

    Branch branch

    A branch for the switch case.

    Properties

    | Improve this Doc 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 Branch Branch { get; }
    Property Value
    Type Description
    Branch

    The switch case's branch.

    | Improve this Doc 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 ImmutableHashSet<Constant> Values { get; }
    Property Value
    Type Description
    System.Collections.Immutable.ImmutableHashSet<Constant>

    The switch case's values.

    Methods

    | Improve this Doc 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
    System.Boolean

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

    | Improve this Doc View Source

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean
    Overrides
    System.ValueType.Equals(System.Object)
    | Improve this Doc View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.ValueType.GetHashCode()

    Operators

    | Improve this Doc View Source

    Equality(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
    System.Boolean

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

    | Improve this Doc View Source

    Inequality(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
    System.Boolean

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

    Implements

    System.IEquatable<T>
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX