Show / Hide Table of Contents

    Class EncoderState

    Encodes Flame's intermediate representation as Loyc LNodes.

    Inheritance
    System.Object
    EncoderState
    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.Ir
    Assembly: Flame.Ir.dll
    Syntax
    public sealed class EncoderState

    Constructors

    | Improve this Doc View Source

    EncoderState()

    Instantiates a Flame IR encoder.

    Declaration
    public EncoderState()
    | Improve this Doc View Source

    EncoderState(IrCodec)

    Instantiates a Flame IR encoder.

    Declaration
    public EncoderState(IrCodec codec)
    Parameters
    Type Name Description
    IrCodec codec

    The codec to use for encoding.

    | Improve this Doc View Source

    EncoderState(IrCodec, LNodeFactory)

    Instantiates a Flame IR encoder.

    Declaration
    public EncoderState(IrCodec codec, LNodeFactory factory)
    Parameters
    Type Name Description
    IrCodec codec

    The codec to use for encoding.

    Loyc.Syntax.LNodeFactory factory

    The node factory to use for creating nodes.

    Properties

    | Improve this Doc View Source

    Codec

    Gets the codec used by this encoder.

    Declaration
    public IrCodec Codec { get; }
    Property Value
    Type Description
    IrCodec

    A Flame IR codec.

    | Improve this Doc View Source

    Factory

    Gets the node factory for this encoder.

    Declaration
    public LNodeFactory Factory { get; }
    Property Value
    Type Description
    Loyc.Syntax.LNodeFactory

    A node factory.

    Methods

    | Improve this Doc View Source

    Encode(AttributeMap)

    Encodes an attribute map as a sequence of LNodes.

    Declaration
    public IEnumerable<LNode> Encode(AttributeMap attributes)
    Parameters
    Type Name Description
    AttributeMap attributes

    The attribute map to encode.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<Loyc.Syntax.LNode>

    A list of attribute nodes.

    | Improve this Doc View Source

    Encode(FlowGraph)

    Encodes a control-flow graph.

    Declaration
    public LNode Encode(FlowGraph graph)
    Parameters
    Type Name Description
    FlowGraph graph

    The control-flow graph to encode.

    Returns
    Type Description
    Loyc.Syntax.LNode

    An LNode that represents the control-flow graph.

    | Improve this Doc View Source

    Encode(InstructionPrototype)

    Encodes an instruction prototype.

    Declaration
    public LNode Encode(InstructionPrototype prototype)
    Parameters
    Type Name Description
    InstructionPrototype prototype

    The instruction prototype to encode.

    Returns
    Type Description
    Loyc.Syntax.LNode

    An encoded instruction prototype.

    | Improve this Doc View Source

    Encode(Alignment)

    Encodes an alignment.

    Declaration
    public LNode Encode(Alignment alignment)
    Parameters
    Type Name Description
    Alignment alignment

    Am alignment to encode.

    Returns
    Type Description
    Loyc.Syntax.LNode

    The encoded alignment.

    | Improve this Doc View Source

    Encode(MethodLookup)

    Encodes a method lookup strategy as an LNode.

    Declaration
    public LNode Encode(MethodLookup lookup)
    Parameters
    Type Name Description
    MethodLookup lookup

    A method lookup strategy.

    Returns
    Type Description
    Loyc.Syntax.LNode

    An LNode that represents lookup.

    | Improve this Doc View Source

    Encode(Constant)

    Encodes a constant value.

    Declaration
    public LNode Encode(Constant value)
    Parameters
    Type Name Description
    Constant value

    The value to encode.

    Returns
    Type Description
    Loyc.Syntax.LNode

    An encoded constant value.

    | Improve this Doc View Source

    Encode(IAttribute)

    Encodes an attribute as an LNode.

    Declaration
    public LNode Encode(IAttribute attribute)
    Parameters
    Type Name Description
    IAttribute attribute

    The attribute to encode.

    Returns
    Type Description
    Loyc.Syntax.LNode

    An encoded node.

    | Improve this Doc View Source

    Encode(IField)

    Encodes a field reference.

    Declaration
    public LNode Encode(IField field)
    Parameters
    Type Name Description
    IField field

    The field reference to encode.

    Returns
    Type Description
    Loyc.Syntax.LNode

    An encoded field reference.

    | Improve this Doc View Source

    Encode(IGenericMember)

    Encodes a generic member reference.

    Declaration
    public LNode Encode(IGenericMember genericMember)
    Parameters
    Type Name Description
    IGenericMember genericMember

    The generic member to encode.

    Returns
    Type Description
    Loyc.Syntax.LNode

    An encoded generic member reference.

    | Improve this Doc View Source

    Encode(IMethod)

    Encodes a method reference.

    Declaration
    public LNode Encode(IMethod method)
    Parameters
    Type Name Description
    IMethod method

    The method reference to encode.

    Returns
    Type Description
    Loyc.Syntax.LNode

    An encoded method reference.

    | Improve this Doc View Source

    Encode(IProperty)

    Encodes a property reference.

    Declaration
    public LNode Encode(IProperty property)
    Parameters
    Type Name Description
    IProperty property

    The property reference to encode.

    Returns
    Type Description
    Loyc.Syntax.LNode

    An encoded property reference.

    | Improve this Doc View Source

    Encode(IType)

    Encodes a type reference.

    Declaration
    public LNode Encode(IType type)
    Parameters
    Type Name Description
    IType type

    The type reference to encode.

    Returns
    Type Description
    Loyc.Syntax.LNode

    An encoded type reference.

    | Improve this Doc View Source

    Encode(QualifiedName)

    Encodes a qualified name as a sequence of simple names.

    Declaration
    public LNode Encode(QualifiedName name)
    Parameters
    Type Name Description
    QualifiedName name

    A qualified name to encode. Simple names in the qualified name are encoded as such. Other names are encoded as simple names by taking their string representation.

    Returns
    Type Description
    Loyc.Syntax.LNode

    An encoded node.

    | Improve this Doc View Source

    Encode(UnqualifiedName)

    Encodes an unqualified name as a simple name.

    Declaration
    public LNode Encode(UnqualifiedName name)
    Parameters
    Type Name Description
    UnqualifiedName name

    An unqualified name to encode. Simple names are encoded as such. Other names are encoded as simple names by taking their string representation.

    Returns
    Type Description
    Loyc.Syntax.LNode

    An encoded node.

    | Improve this Doc View Source

    Encode(Boolean)

    Encodes a Boolean constant.

    Declaration
    public LNode Encode(bool value)
    Parameters
    Type Name Description
    System.Boolean value

    A Boolean constant to encode.

    Returns
    Type Description
    Loyc.Syntax.LNode

    The encoded Boolean constant.

    | Improve this Doc View Source

    Encode(Int32)

    Encodes a 32-bit signed integer constant.

    Declaration
    public LNode Encode(int value)
    Parameters
    Type Name Description
    System.Int32 value

    A 32-bit signed integer constant to encode.

    Returns
    Type Description
    Loyc.Syntax.LNode

    The encoded 32-bit signed integer constant.

    | Improve this Doc View Source

    EncodeDefinition(IAssembly)

    Encodes an assembly definition.

    Declaration
    public LNode EncodeDefinition(IAssembly assembly)
    Parameters
    Type Name Description
    IAssembly assembly

    The assembly definition to encode.

    Returns
    Type Description
    Loyc.Syntax.LNode

    An LNode that represents the assembly definition.

    | Improve this Doc View Source

    EncodeDefinition(IType)

    Encodes a type definition.

    Declaration
    public LNode EncodeDefinition(IType typeDefinition)
    Parameters
    Type Name Description
    IType typeDefinition

    The type definition to encode.

    Returns
    Type Description
    Loyc.Syntax.LNode

    An LNode that represents the type definition.

    | Improve this Doc View Source

    EncodeDefinition(ITypeMember)

    Encodes a type member definition.

    Declaration
    public LNode EncodeDefinition(ITypeMember memberDefinition)
    Parameters
    Type Name Description
    ITypeMember memberDefinition

    The type member definition to encode.

    Returns
    Type Description
    Loyc.Syntax.LNode

    An LNode that represents the type member definition.

    | Improve this Doc View Source

    EncodeDefinition(Parameter)

    Encodes a parameter definition as an LNode.

    Declaration
    public LNode EncodeDefinition(Parameter parameter)
    Parameters
    Type Name Description
    Parameter parameter

    The parameter to encode.

    Returns
    Type Description
    Loyc.Syntax.LNode

    An encoded node.

    | Improve this Doc View Source

    WithCodec(IrCodec)

    Creates an encoder state that uses a particular codec but retains all other fields.

    Declaration
    public EncoderState WithCodec(IrCodec newCodec)
    Parameters
    Type Name Description
    IrCodec newCodec

    The new codec to use.

    Returns
    Type Description
    EncoderState

    An encoder state that uses newCodec.

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