Search Results for

    Show / Hide Table of Contents

    Class DecoderState

    Decodes Loyc LNodes to Flame's intermediate representation.

    Inheritance
    object
    DecoderState
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Flame.Ir
    Assembly: Flame.Ir.dll
    Syntax
    public sealed class DecoderState

    Constructors

    | Edit this page View Source

    DecoderState(ILog, ReadOnlyTypeResolver)

    Creates a decoder that relies on the default codec.

    Declaration
    public DecoderState(ILog log, ReadOnlyTypeResolver typeResolver)
    Parameters
    Type Name Description
    ILog log

    A log to use for error and warning messages.

    ReadOnlyTypeResolver typeResolver

    A read-only type resolver for resolving types.

    | Edit this page View Source

    DecoderState(ILog, ReadOnlyTypeResolver, IrCodec)

    Creates a decoder.

    Declaration
    public DecoderState(ILog log, ReadOnlyTypeResolver typeResolver, IrCodec codec)
    Parameters
    Type Name Description
    ILog log

    A log to use for error and warning messages.

    ReadOnlyTypeResolver typeResolver

    A read-only type resolver for resolving types.

    IrCodec codec

    A Flame IR codec.

    Properties

    | Edit this page View Source

    Codec

    Gets the codec used by this decoder.

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

    The codec.

    | Edit this page View Source

    DefiningType

    Gets the type that either is or defines the current decoding scope.

    Declaration
    public IType DefiningType { get; }
    Property Value
    Type Description
    IType
    | Edit this page View Source

    Log

    Gets a log to use for error and warning messages.

    Declaration
    public ILog Log { get; }
    Property Value
    Type Description
    ILog

    A log.

    | Edit this page View Source

    Scope

    Gets the scope in which elements are decoded.

    Declaration
    public TypeParent Scope { get; }
    Property Value
    Type Description
    TypeParent

    The scope in which elements are decoded, represented as a type parent.

    | Edit this page View Source

    TypeMemberIndex

    Gets an index that allows for quick type member lookup.

    Declaration
    public Index<IType, UnqualifiedName, ITypeMember> TypeMemberIndex { get; }
    Property Value
    Type Description
    Index<IType, UnqualifiedName, ITypeMember>

    A type member lookup index.

    | Edit this page View Source

    TypeResolver

    Gets the read-only type resolver for this decoder state.

    Declaration
    public ReadOnlyTypeResolver TypeResolver { get; }
    Property Value
    Type Description
    ReadOnlyTypeResolver

    A type resolver.

    Methods

    | Edit this page View Source

    AssertDecodeEnum<T>(LNode, IReadOnlyDictionary<Symbol, T>, string, out T)

    Decodes an id node using a symbol-to-value mapping. An error is reported if the node cannot be decoded.

    Declaration
    public bool AssertDecodeEnum<T>(LNode node, IReadOnlyDictionary<Symbol, T> decodeMap, string enumDescription, out T result)
    Parameters
    Type Name Description
    LNode node

    A node to decode.

    IReadOnlyDictionary<Symbol, T> decodeMap

    A mapping of symbols to values that is used for decoding the node.

    string enumDescription

    A short description of the type of value that is being decoded, e.g., "method lookup strategy".

    T result

    The decoded value, if any.

    Returns
    Type Description
    bool

    true if the node could be decoded; otherwise, false.

    Type Parameters
    Name Description
    T
    | Edit this page View Source

    AssertDecodeGenericMember(LNode, out IGenericMember)

    Decodes an LNode as a reference to a generic member. Logs an error if the decoding process fails.

    Declaration
    public bool AssertDecodeGenericMember(LNode node, out IGenericMember genericMember)
    Parameters
    Type Name Description
    LNode node

    A node to decode as a generic member.

    IGenericMember genericMember

    The generic member described by node.

    Returns
    Type Description
    bool

    true if node can be decoded as a generic member; otherwise, false.

    | Edit this page View Source

    AssertDecodeInt32(LNode, out int)

    Decodes an LNode as a 32-bit signed integer constant and returns a Boolean flag telling if the decoding operation was successful.

    Declaration
    public bool AssertDecodeInt32(LNode node, out int result)
    Parameters
    Type Name Description
    LNode node

    The node to decode.

    int result

    A 32-bit signed integer.

    Returns
    Type Description
    bool

    true if node was successfully decoded as a 32-bit signed integer; otherwise, false.

    | Edit this page View Source

    AssertDecodeQualifiedName(LNode, out QualifiedName)

    Decodes an LNode as a qualified name. Logs an error if the decoding process fails.

    Declaration
    public bool AssertDecodeQualifiedName(LNode node, out QualifiedName name)
    Parameters
    Type Name Description
    LNode node

    A node to decode as a qualified name.

    QualifiedName name

    The name described by node.

    Returns
    Type Description
    bool

    true if node can be decoded as a qualified name; otherwise, false.

    | Edit this page View Source

    AssertDecodeSimpleName(LNode, out SimpleName)

    Decodes an LNode as a simple name. Logs an error if the decoding process fails.

    Declaration
    public bool AssertDecodeSimpleName(LNode node, out SimpleName name)
    Parameters
    Type Name Description
    LNode node

    A node to decode as a simple name.

    SimpleName name

    The name described by node.

    Returns
    Type Description
    bool

    true if node can be decoded as a simple name; otherwise, false.

    | Edit this page View Source

    DecodeAlignment(LNode)

    Decodes an LNode as an alignment.

    Declaration
    public Alignment DecodeAlignment(LNode node)
    Parameters
    Type Name Description
    LNode node

    A node to decode as an alignment.

    Returns
    Type Description
    Alignment

    The decoded alignment.

    | Edit this page View Source

    DecodeAssembly(LNode)

    Decodes an assembly.

    Declaration
    public IAssembly DecodeAssembly(LNode node)
    Parameters
    Type Name Description
    LNode node

    The assembly to decode.

    Returns
    Type Description
    IAssembly

    A decoded assembly.

    | Edit this page View Source

    DecodeAttribute(LNode)

    Decodes an attribute node.

    Declaration
    public IAttribute DecodeAttribute(LNode node)
    Parameters
    Type Name Description
    LNode node

    The attribute node to decode.

    Returns
    Type Description
    IAttribute

    An attribute node.

    | Edit this page View Source

    DecodeAttributeMap(IEnumerable<LNode>)

    Decodes a sequence of attribute nodes as an attribute map.

    Declaration
    public AttributeMap DecodeAttributeMap(IEnumerable<LNode> attributeNodes)
    Parameters
    Type Name Description
    IEnumerable<LNode> attributeNodes

    The nodes to decode.

    Returns
    Type Description
    AttributeMap

    An attribute map.

    | Edit this page View Source

    DecodeBoolean(LNode)

    Decodes an LNode as a Boolean constant.

    Declaration
    public bool DecodeBoolean(LNode node)
    Parameters
    Type Name Description
    LNode node

    The node to decode.

    Returns
    Type Description
    bool

    A Boolean constant.

    | Edit this page View Source

    DecodeConstant(LNode)

    Decodes an LNode as a constant value.

    Declaration
    public Constant DecodeConstant(LNode node)
    Parameters
    Type Name Description
    LNode node

    The node to decode.

    Returns
    Type Description
    Constant

    A decoded constant.

    | Edit this page View Source

    DecodeField(LNode)

    Decoes an LNode as a field reference.

    Declaration
    public IField DecodeField(LNode node)
    Parameters
    Type Name Description
    LNode node

    The node to decode.

    Returns
    Type Description
    IField

    A decode field reference.

    | Edit this page View Source

    DecodeFlowGraph(LNode)

    Decodes a control-flow graph as a method body.

    Declaration
    public FlowGraph DecodeFlowGraph(LNode node)
    Parameters
    Type Name Description
    LNode node

    An encoded control-flow graph.

    Returns
    Type Description
    FlowGraph

    A new method body that includes the decoded control-flow graph.

    | Edit this page View Source

    DecodeGenericParameterDefinition(LNode)

    Decodes an LNode as a generic parameter definition.

    Declaration
    public IGenericParameter DecodeGenericParameterDefinition(LNode node)
    Parameters
    Type Name Description
    LNode node

    The node to decode.

    Returns
    Type Description
    IGenericParameter

    A decoded generic parameter.

    | Edit this page View Source

    DecodeInstructionProtoype(LNode)

    Decodes an LNode as an instruction prototype.

    Declaration
    public InstructionPrototype DecodeInstructionProtoype(LNode node)
    Parameters
    Type Name Description
    LNode node

    The node to decode.

    Returns
    Type Description
    InstructionPrototype

    A decoded instruction prototype.

    | Edit this page View Source

    DecodeInt32(LNode)

    Decodes an LNode as a 32-bit signed integer constant.

    Declaration
    public int DecodeInt32(LNode node)
    Parameters
    Type Name Description
    LNode node

    The node to decode.

    Returns
    Type Description
    int

    A 32-bit signed integer.

    | Edit this page View Source

    DecodeMethod(LNode)

    Decodes an LNode as a method reference.

    Declaration
    public IMethod DecodeMethod(LNode node)
    Parameters
    Type Name Description
    LNode node

    The node to decode.

    Returns
    Type Description
    IMethod

    A decoded method reference.

    | Edit this page View Source

    DecodeMethodLookup(LNode)

    Decodes an LNode as a method lookup strategy.

    Declaration
    public MethodLookup DecodeMethodLookup(LNode node)
    Parameters
    Type Name Description
    LNode node

    The node to decode.

    Returns
    Type Description
    MethodLookup

    A method lookup strategy.

    | Edit this page View Source

    DecodeParameter(LNode)

    Decodes a parameter node.

    Declaration
    public Parameter DecodeParameter(LNode node)
    Parameters
    Type Name Description
    LNode node

    A parameter node to decode.

    Returns
    Type Description
    Parameter

    A decoded parameter.

    | Edit this page View Source

    DecodeProperty(LNode)

    Decodes an LNode as a property reference.

    Declaration
    public IProperty DecodeProperty(LNode node)
    Parameters
    Type Name Description
    LNode node

    The node to decode.

    Returns
    Type Description
    IProperty

    A decoded property reference.

    | Edit this page View Source

    DecodeQualifiedName(LNode)

    Decodes an LNode as a qualified name. Logs an error if the decoding process fails.

    Declaration
    public QualifiedName DecodeQualifiedName(LNode node)
    Parameters
    Type Name Description
    LNode node

    A node to decode as a qualified name.

    Returns
    Type Description
    QualifiedName

    The name described by node if node can be decoded as a qualified name; otherwise, a default qualified name.

    | Edit this page View Source

    DecodeSimpleName(LNode)

    Decodes an LNode as a simple name. Logs an error if the decoding process fails.

    Declaration
    public SimpleName DecodeSimpleName(LNode node)
    Parameters
    Type Name Description
    LNode node

    A node to decode as a simple name.

    Returns
    Type Description
    SimpleName

    The name described by node if node can be decoded as a simple name; otherwise, a sensible default simple name.

    | Edit this page View Source

    DecodeType(LNode)

    Decodes an LNode as a type reference.

    Declaration
    public IType DecodeType(LNode node)
    Parameters
    Type Name Description
    LNode node

    The node to decode.

    Returns
    Type Description
    IType

    A decoded type reference.

    | Edit this page View Source

    DecodeTypeDefinition(LNode)

    Decodes an LNode as a type definition.

    Declaration
    public IType DecodeTypeDefinition(LNode node)
    Parameters
    Type Name Description
    LNode node

    The node to decode.

    Returns
    Type Description
    IType

    A decoded type definition.

    | Edit this page View Source

    DecodeTypeMemberDefinition(LNode)

    Decodes an LNode as a type member definition.

    Declaration
    public ITypeMember DecodeTypeMemberDefinition(LNode node)
    Parameters
    Type Name Description
    LNode node

    The node to decode.

    Returns
    Type Description
    ITypeMember

    A decoded type member definition.

    | Edit this page View Source

    WithScope(TypeParent)

    Creates a new decoder state that is identical to this decoder state in every way except for the decoding scope.

    Declaration
    public DecoderState WithScope(TypeParent newScope)
    Parameters
    Type Name Description
    TypeParent newScope

    The decoding scope for the new decoder state.

    Returns
    Type Description
    DecoderState

    A new decoder state.

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