Show / Hide Table of Contents

    Class MethodBody

    A method body: a method implementation represented as a control-flow graph along with a private copy of the return parameter, 'this' parameter and input parameters.

    Inheritance
    System.Object
    MethodBody
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Flame.Compiler
    Assembly: Flame.Compiler.dll
    Syntax
    public sealed class MethodBody

    Constructors

    | Improve this Doc View Source

    MethodBody(Parameter, Parameter, IReadOnlyList<Parameter>, FlowGraph)

    Creates a method implementation.

    Declaration
    public MethodBody(Parameter returnParameter, Parameter thisParameter, IReadOnlyList<Parameter> parameters, FlowGraph implementation)
    Parameters
    Type Name Description
    Parameter returnParameter

    The method implementation's return parameter.

    Parameter thisParameter

    The method implementation's 'this' parameter.

    System.Collections.Generic.IReadOnlyList<Parameter> parameters

    The method implementation's input parameters.

    FlowGraph implementation

    The method implementation, represented as a control-flow graph.

    Properties

    | Improve this Doc View Source

    Implementation

    Gets the control-flow graph that constitutes the method implementation.

    Declaration
    public FlowGraph Implementation { get; }
    Property Value
    Type Description
    FlowGraph

    The method implementation.

    | Improve this Doc View Source

    Members

    Gets a sequence that contains all members that appear in the method body.

    Declaration
    public IEnumerable<IMember> Members { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<IMember>

    A sequence of types, methods and fields.

    | Improve this Doc View Source

    Parameters

    Gets the method implementation's input parameter list.

    Declaration
    public IReadOnlyList<Parameter> Parameters { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyList<Parameter>

    The parameter list.

    | Improve this Doc View Source

    ReturnParameter

    Gets the method implementation's return parameter.

    Declaration
    public Parameter ReturnParameter { get; }
    Property Value
    Type Description
    Parameter

    The return parameter.

    | Improve this Doc View Source

    ThisParameter

    Gets the method implementation's 'this' parameter, if any.

    Declaration
    public Parameter ThisParameter { get; }
    Property Value
    Type Description
    Parameter

    The 'this' parameter.

    Methods

    | Improve this Doc View Source

    Map(MemberMapping)

    Applies a member mapping to this method body's implementation, 'this' parameter, parameter list and return parameter. The result is returned as a new method body.

    Declaration
    public MethodBody Map(MemberMapping memberMapping)
    Parameters
    Type Name Description
    MemberMapping memberMapping

    The member mapping to apply.

    Returns
    Type Description
    MethodBody

    A new method body.

    | Improve this Doc View Source

    Validate()

    Validates this method body and returns a list of error messages.

    Declaration
    public IReadOnlyList<string> Validate()
    Returns
    Type Description
    System.Collections.Generic.IReadOnlyList<System.String>

    A list of error messages.

    | Improve this Doc View Source

    WithImplementation(FlowGraph)

    Creates a method body based on this method body, but with a different implementation.

    Declaration
    public MethodBody WithImplementation(FlowGraph newImplementation)
    Parameters
    Type Name Description
    FlowGraph newImplementation

    The implementation of the method body to create.

    Returns
    Type Description
    MethodBody

    A new method body.

    • Improve this Doc
    • View Source
    Back to top Generated by DocFX