Class InstructionPrototype
Describes an instruction's prototype: everything there is to an instruction except for its arguments.
Inheritance
Inherited Members
Namespace: Flame.Compiler
Assembly: Flame.Compiler.dll
Syntax
public abstract class InstructionPrototype
Properties
| Improve this Doc View SourceMembers
Collects all members that appear in this instruction prototype.
Declaration
public IEnumerable<IMember> Members { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IMember> | A sequence of members. |
ParameterCount
Gets the number of arguments this instruction takes when instantiated.
Declaration
public abstract int ParameterCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The number of arguments this instruction takes. |
ResultType
Gets the type of value produced instantiations of this prototype.
Declaration
public abstract IType ResultType { get; }
Property Value
Type | Description |
---|---|
IType | A type of value. |
Methods
| Improve this Doc View SourceAssertIsPrototypeOf(Instruction)
Asserts that a particular instruction is an instance of this prototype.
Declaration
public void AssertIsPrototypeOf(Instruction instruction)
Parameters
Type | Name | Description |
---|---|---|
Instruction | instruction | The instruction to examine. |
AssertIsPrototypeOf(Instruction, String)
Asserts that a particular instruction is an instance of this prototype.
Declaration
public void AssertIsPrototypeOf(Instruction instruction, string errorMessage)
Parameters
Type | Name | Description |
---|---|---|
Instruction | instruction | The instruction to examine. |
System.String | errorMessage | An error message to print if the assertion does not hold true. |
CheckConformance(Instruction, MethodBody)
Checks if a particular instance of this prototype conforms to the rules for this instruction prototype.
Declaration
public abstract IReadOnlyList<string> CheckConformance(Instruction instance, MethodBody body)
Parameters
Type | Name | Description |
---|---|---|
Instruction | instance | An instance of this prototype. |
MethodBody | body | The method body that defines the instruction. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.String> | A list of conformance errors in the instruction. |
Instantiate(IReadOnlyList<ValueTag>)
Instantiates this prototype with a list of arguments.
Declaration
public Instruction Instantiate(IReadOnlyList<ValueTag> arguments)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IReadOnlyList<ValueTag> | arguments | The arguments to instantiate this prototype with. |
Returns
Type | Description |
---|---|
Instruction | An instruction whose prototype is equal to this prototype
and whose argument list is |
IsPrototypeOf(Instruction)
Tests if a particular instruction is an instance of this prototype.
Declaration
public bool IsPrototypeOf(Instruction instruction)
Parameters
Type | Name | Description |
---|---|---|
Instruction | instruction | The instruction to examine. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Map(MemberMapping)
Applies a member mapping to this instruction prototype.
Declaration
public abstract InstructionPrototype Map(MemberMapping mapping)
Parameters
Type | Name | Description |
---|---|---|
MemberMapping | mapping | A member mapping. |
Returns
Type | Description |
---|---|
InstructionPrototype | A transformed instruction prototype. |