Represents a code fragment that has been compiled and can now be written out as IL.
Public Member Functions | |
CompiledFragment () | |
An empty constructor used for inheriting this class. More... | |
object | ActiveValue () |
Gets the active value of this fragment. More... | |
CompiledFragment (object value) | |
Creates a new compiled fragment for the given constant value. More... | |
virtual bool | IsConstant () |
Checks if this fragment is a constant value. More... | |
bool | IsLogical () |
Checks if this fragment can be used logically. More... | |
Type | OutputType () |
Returns the type that this fragment produces when it's executed. For example, int+int will output another int. This must only be used when it's known that a fragment won't replace itself. More... | |
virtual Type | OutputType (out CompiledFragment v) |
Returns the type that this fragment produces when it's executed. For example, int+int will output another int. More... | |
override CompiledFragment | Compile (CompiledMethod method) |
Compiles this CodeFragment into a CompiledFragment. More... | |
virtual void | OutputIL (NitroIL into) |
Generates the IL of this operation into the given stream. More... | |
void | EmitValue (Type type, NitroIL into) |
Emits the Value held by this compiled fragment if possible. More... | |
Public Member Functions inherited from Nitro.CodeFragment | |
void | Error (string message) |
Throws an error, outputting the line number it occured on. More... | |
virtual bool | IsMemberAccessor () |
A value which states if this fragment accesses members (methods/fields) of something. More... | |
virtual int | GetLineNumber () |
Returns the line number this fragment came from. More... | |
void | AddToStart (CodeFragment parent) |
Adds this code fragment to the beginning of the given parents child set. More... | |
void | AddBefore (CodeFragment frag) |
Adds this code fragment as a child before the given one. More... | |
void | AddAfter (CodeFragment frag) |
Adds this code fragment as a child after the given one. More... | |
void | Remove () |
Removes this fragment from its parent. More... | |
void | AddChild (CodeFragment child) |
Adds the given fragment as a child of this one. More... | |
virtual bool | Typeable () |
Defines if a fragment can be given a :TYPE. E.g. Brackets (for casting, (A):TYPE) and variables can. More... | |
int | ChildCount () |
How many children does this fragment have? More... | |
virtual AddResult | AddTo (CodeFragment to, CodeLexer sr) |
Adds this fragment as a child to the given fragment. It may be overriden by some types of fragment as they may wish to handle it differently. More... | |
override string | ToString () |
Converts this fragment into a code string. More... | |
Public Attributes | |
object | Value |
A constant value if this fragment has one. E.g. strings, ints etc. go here. More... | |
Public Attributes inherited from Nitro.CodeFragment | |
TypeFragment | GivenType |
A type (:TYPE) which was explicitly given to this block. More... | |
CodeFragment | NextChild |
The child after this one. More... | |
CodeFragment | LastChild |
The last child of this fragment, stored as a linked list. More... | |
CodeFragment | FirstChild |
The first child of this fragment, stored as a linked list. More... | |
CodeFragment | PreviousChild |
The child before this one. More... | |
CodeFragment | ParentFragment |
The parent fragment of this, if any. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Nitro.CodeFragment | |
static int | IsOfType (char[] arrayToSearch, char charToFind) |
Returns the index in the given array of the given character if it's found in it. More... | |
Properties inherited from Nitro.CodeFragment | |
bool | IsParent [get] |
Is this fragment a parent or not? More... | |
|
inline |
An empty constructor used for inheriting this class.
|
inline |
Creates a new compiled fragment for the given constant value.
value | The constant value for this fragment. |
|
inline |
Gets the active value of this fragment.
|
inlinevirtual |
Compiles this CodeFragment into a CompiledFragment.
method | The method that this fragment occurs in. |
Reimplemented from Nitro.CodeFragment.
Emits the Value held by this compiled fragment if possible.
type | The type of the value (or one of the base types of the value). |
into | The IL stream to output the IL into. |
|
inlinevirtual |
Checks if this fragment is a constant value.
Reimplemented in Nitro.Operation.
|
inline |
Checks if this fragment can be used logically.
|
inlinevirtual |
Generates the IL of this operation into the given stream.
into | The IL stream to output the IL into |
Reimplemented in Nitro.PropertyOperation, Nitro.MethodOperation, Nitro.IndexOperation, Nitro.SetOperation, Nitro.ArrayOperation, Nitro.ConstructOperation, Nitro.SwitchOperation, Nitro.IfOperation, Nitro.AddOperation, Nitro.CastOperation, Nitro.ForOperation, Nitro.BreakOperation, Nitro.ContinueOperation, Nitro.EqualsOperation, Nitro.BoxOperation, Nitro.SubtractOperation, Nitro.UnboxOperation, Nitro.ReturnOperation, Nitro.DivideOperation, Nitro.GreaterThanOperation, Nitro.LessThanOperation, Nitro.MultiplyOperation, Nitro.TypeOperation, Nitro.AndOperation, Nitro.BitwiseXOrOperation, Nitro.ModuloOperation, Nitro.OrOperation, Nitro.ShiftLeftOperation, Nitro.ShiftRightOperation, Nitro.BaseOperation, and Nitro.ThisOperation.
|
inline |
Returns the type that this fragment produces when it's executed. For example, int+int will output another int. This must only be used when it's known that a fragment won't replace itself.
|
inlinevirtual |
Returns the type that this fragment produces when it's executed. For example, int+int will output another int.
v | In some cases, checking the output type will generate a new fragment. This value is the new fragment and it must always replace the original fragment that OutputType was called on. |
Reimplemented in Nitro.MethodOperation, Nitro.PropertyOperation, Nitro.SwitchOperation, Nitro.ConstructOperation, Nitro.ArrayOperation, Nitro.IfOperation, Nitro.IndexOperation, Nitro.ForOperation, Nitro.BreakOperation, Nitro.SetOperation, Nitro.ContinueOperation, Nitro.CastOperation, Nitro.UnboxOperation, Nitro.BoxOperation, Nitro.ReturnOperation, Nitro.TypeOperation, Nitro.AddOperation, Nitro.AndOperation, Nitro.BitwiseXOrOperation, Nitro.DivideOperation, Nitro.EqualsOperation, Nitro.GreaterThanOperation, Nitro.LessThanOperation, Nitro.ModuloOperation, Nitro.MultiplyOperation, Nitro.OrOperation, Nitro.ShiftLeftOperation, Nitro.ShiftRightOperation, Nitro.SubtractOperation, Nitro.BaseOperation, and Nitro.ThisOperation.
object Nitro.CompiledFragment.Value |
A constant value if this fragment has one. E.g. strings, ints etc. go here.