Show / Hide Table of Contents

    Class DecoderState

    Decodes Loyc LNodes to Flame's intermediate representation.

    Inheritance
    System.Object
    DecoderState
    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 DecoderState

    Constructors

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

    A log to use for error and warning messages.

    ReadOnlyTypeResolver typeResolver

    A read-only type resolver for resolving types.

    | Improve this Doc View Source

    DecoderState(ILog, ReadOnlyTypeResolver, IrCodec)

    Creates a decoder.

    Declaration
    public DecoderState(ILog log, ReadOnlyTypeResolver typeResolver, IrCodec codec)
    Parameters
    Type Name Description
    Pixie.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

    | Improve this Doc View Source

    Codec

    Gets the codec used by this decoder.

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

    The codec.

    | Improve this Doc 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
    | Improve this Doc View Source

    Log

    Gets a log to use for error and warning messages.

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

    A log.

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

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

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

    | Improve this Doc 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
    Loyc.Syntax.LNode node

    A node to decode.

    System.Collections.Generic.IReadOnlyDictionary<Loyc.Symbol, T> decodeMap

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

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

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

    Type Parameters
    Name Description
    T
    | Improve this Doc 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
    Loyc.Syntax.LNode node

    A node to decode as a generic member.

    IGenericMember genericMember

    The generic member described by node.

    Returns
    Type Description
    System.Boolean

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

    | Improve this Doc View Source

    AssertDecodeInt32(LNode, out Int32)

    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
    Loyc.Syntax.LNode node

    The node to decode.

    System.Int32 result

    A 32-bit signed integer.

    Returns
    Type Description
    System.Boolean

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

    | Improve this Doc 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
    Loyc.Syntax.LNode node

    A node to decode as a qualified name.

    QualifiedName name

    The name described by node.

    Returns
    Type Description
    System.Boolean

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

    | Improve this Doc 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
    Loyc.Syntax.LNode node

    A node to decode as a simple name.

    SimpleName name

    The name described by node.

    Returns
    Type Description
    System.Boolean

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

    | Improve this Doc View Source

    DecodeAlignment(LNode)

    Decodes an LNode as an alignment.

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

    A node to decode as an alignment.

    Returns
    Type Description
    Alignment

    The decoded alignment.

    | Improve this Doc View Source

    DecodeAssembly(LNode)

    Decodes an assembly.

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

    The assembly to decode.

    Returns
    Type Description
    IAssembly

    A decoded assembly.

    | Improve this Doc View Source

    DecodeAttribute(LNode)

    Decodes an attribute node.

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

    The attribute node to decode.

    Returns
    Type Description
    IAttribute

    An attribute node.

    | Improve this Doc 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
    System.Collections.Generic.IEnumerable<Loyc.Syntax.LNode> attributeNodes

    The nodes to decode.

    Returns
    Type Description
    AttributeMap

    An attribute map.

    | Improve this Doc View Source

    DecodeBoolean(LNode)

    Decodes an LNode as a Boolean constant.

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

    The node to decode.

    Returns
    Type Description
    System.Boolean

    A Boolean constant.

    | Improve this Doc View Source

    DecodeConstant(LNode)

    Decodes an LNode as a constant value.

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

    The node to decode.

    Returns
    Type Description
    Constant

    A decoded constant.

    | Improve this Doc View Source

    DecodeField(LNode)

    Decoes an LNode as a field reference.

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

    The node to decode.

    Returns
    Type Description
    IField

    A decode field reference.

    | Improve this Doc View Source

    DecodeFlowGraph(LNode)

    Decodes a control-flow graph as a method body.

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

    An encoded control-flow graph.

    Returns
    Type Description
    FlowGraph

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

    | Improve this Doc View Source

    DecodeGenericParameterDefinition(LNode)

    Decodes an LNode as a generic parameter definition.

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

    The node to decode.

    Returns
    Type Description
    IGenericParameter

    A decoded generic parameter.

    | Improve this Doc View Source

    DecodeInstructionProtoype(LNode)

    Decodes an LNode as an instruction prototype.

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

    The node to decode.

    Returns
    Type Description
    InstructionPrototype

    A decoded instruction prototype.

    | Improve this Doc View Source

    DecodeInt32(LNode)

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

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

    The node to decode.

    Returns
    Type Description
    System.Int32

    A 32-bit signed integer.

    | Improve this Doc View Source

    DecodeMethod(LNode)

    Decodes an LNode as a method reference.

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

    The node to decode.

    Returns
    Type Description
    IMethod

    A decoded method reference.

    | Improve this Doc View Source

    DecodeMethodLookup(LNode)

    Decodes an LNode as a method lookup strategy.

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

    The node to decode.

    Returns
    Type Description
    MethodLookup

    A method lookup strategy.

    | Improve this Doc View Source

    DecodeParameter(LNode)

    Decodes a parameter node.

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

    A parameter node to decode.

    Returns
    Type Description
    Parameter

    A decoded parameter.

    | Improve this Doc View Source

    DecodeProperty(LNode)

    Decodes an LNode as a property reference.

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

    The node to decode.

    Returns
    Type Description
    IProperty

    A decoded property reference.

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

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

    | Improve this Doc View Source

    DecodeType(LNode)

    Decodes an LNode as a type reference.

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

    The node to decode.

    Returns
    Type Description
    IType

    A decoded type reference.

    | Improve this Doc View Source

    DecodeTypeDefinition(LNode)

    Decodes an LNode as a type definition.

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

    The node to decode.

    Returns
    Type Description
    IType

    A decoded type definition.

    | Improve this Doc View Source

    DecodeTypeMemberDefinition(LNode)

    Decodes an LNode as a type member definition.

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

    The node to decode.

    Returns
    Type Description
    ITypeMember

    A decoded type member definition.

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

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