Search Results for

    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
    object
    MethodBody
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Flame.Compiler
    Assembly: Flame.Compiler.dll
    Syntax
    public sealed class MethodBody

    Constructors

    | Edit this page 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.

    IReadOnlyList<Parameter> parameters

    The method implementation's input parameters.

    FlowGraph implementation

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

    Properties

    | Edit this page 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.

    | Edit this page 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
    IEnumerable<IMember>

    A sequence of types, methods and fields.

    | Edit this page View Source

    Parameters

    Gets the method implementation's input parameter list.

    Declaration
    public IReadOnlyList<Parameter> Parameters { get; }
    Property Value
    Type Description
    IReadOnlyList<Parameter>

    The parameter list.

    | Edit this page View Source

    ReturnParameter

    Gets the method implementation's return parameter.

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

    The return parameter.

    | Edit this page 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

    | Edit this page 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.

    | Edit this page View Source

    Validate()

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

    Declaration
    public IReadOnlyList<string> Validate()
    Returns
    Type Description
    IReadOnlyList<string>

    A list of error messages.

    | Edit this page 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.

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX