The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
|
Public Member Functions | |
ILCodeGenerator (TextWriter output) | |
override void | InitialComment () |
Displays de comment to show in the first line of il file. More... | |
override void | Comment (string msg) |
Writes the specified message as a comment in il language More... | |
override void | Comment (int indent, string msg) |
override void | WriteLabel (int indentation, string label) |
Writes a label in il. Format –indentation– LABEL: More... | |
override void | WriteType (TypeExpression type) |
Writes the current type information More... | |
override void | WriteHeader (string fileName) |
Writes the header of the il code file. More... | |
override void | WriteNamespaceHeader (int indent, string name) |
Writes the namespace header of an IL file. More... | |
virtual void | WriteClassName (string name) |
virtual void | WriteClassExtends (ClassType type) |
virtual void | WriteClassImplements (ClassType type) |
override void | WriteLNClassHeader (int indent, string name, ClassType type) |
Writes the class header in IL code More... | |
override void | WriteEndOfClass (int indent, string name) |
Writes the class termination acoording to IL code More... | |
override void | WriteInterfaceHeader (int indent, string name, InterfaceType type) |
Writes the interface header More... | |
override void | WriteEndOfInterface (int indent, string name) |
Writes the interface termination More... | |
virtual void | ProcessField (int indent, FieldDeclaration node, Object obj, bool constantField) |
override void | WriteField (int indent, string name, FieldType type, bool constantField) |
Writes the field header. More... | |
override void | WriteLNFieldInitialization (TypeExpression type) |
Writes the field inicialization. More... | |
override void | WriteEndOfField () |
Writes the field termination More... | |
override void | WriteStartBlock (int indent) |
Writes the block inicialization More... | |
override void | WriteEndOfBlock (int indent) |
Writes the termination token More... | |
override void | WriteLNMethodHeader (int indent, string name, MethodType type) |
Writes the method header. More... | |
virtual void | WriteMethodTypeOfAccess (string name, MethodType type) |
virtual void | WriteMethodParameters (MethodType type) |
override void | WriteEndOfMethod (int indent, string name) |
Writes the method termination. It writes also en end of line More... | |
override void | WriteParams (MethodType memberType, AST.CompoundExpression arguments) |
override void | AddLocalVariable (string name, TypeExpression type) |
Stores the information of the local variable. More... | |
override void | WriteLocalVariable (int indent) |
Writes the information of local variables. More... | |
override void | WriteAuxiliarLocalVariable (int indent, string id, string type) |
Writes the information of local variables. More... | |
override void | WriteEntryPoint (int indent) |
Writes the entrypoint directive. More... | |
override void | WriteTryDirective (int indent) |
override void | WriteOpenBraceTry (int indent) |
override void | WriteCloseBraceTry (int indent) |
void | WriteRethrow (int indent) |
override void | WriteCatch (int indent, String type, String var) |
override void | WriteOpenBraceCatch (int indent) |
override void | WriteCloseBraceCatch (int indent) |
override void | WriteFinally (int indent) |
override void | WriteOpenBraceFinally (int indent) |
override void | WriteCloseBraceFinally (int indent) |
virtual void | WriteThrowMissingMethodException (int indent, string method) |
virtual void | WriteThrowNonSuitableObjectException (int indent, string klass, string method) |
void | AddExceptionCode (DynamicExceptionManager typeException) |
Adds the information of specified exception to include in intermediate code file. More... | |
virtual void | Exit (int indent, int res) |
Checks if the union type can to promote to the specified type. More... | |
void | Promotion (int indent, TypeExpression typeExp1, TypeExpression certainType1, TypeExpression typeExp2, TypeExpression certainType2, bool unidirectionalConversion, bool makeBoxing) |
Writes the il code to promote typeExp1 to typeExp2 More... | |
override void | WriteThrowException (int indent, DynamicExceptionManager dynException) |
Writes the generation code to throw a specified exception. More... | |
override void | WriteThrowException (int indent, string ex, string[] msg) |
Writes the code to throw an exception derived from Exception without using DynamicExceptionManager . More... | |
void | ldobj (int indent, TypeExpression val) |
Writes the ldobj instruction. More... | |
void | ldstr (int indent, string val) |
Writes the ldstr instruction. More... | |
void | ldnull (int indent) |
Writes the ldnull instruction. More... | |
void | newobj (int indent, MethodType memberType, TypeExpression obj, string member) |
Writes the newobj instruction. More... | |
void | newobj (int indent, string klass, string[] args) |
Writes the newobj instruction More... | |
void | castclass (int indent, TypeExpression token) |
Writes the castclass instruction. More... | |
void | WriteThrow (int indent) |
Writes the throw instruction. More... | |
void | ldarg (int indent, int argNumber) |
ldarg <unsigned int16>=""> Load the argument number <unsigned int16>=""> on the stack. The argument enumeration is zero-based, but it’s important to remember that instance methods have an 'invisible' argument not specified in the method signature: the class instance pointer, this, which is always argument number 0. Because static methods don’t have such an 'invisible' argument, for them argument number 0 is the first argument specified in More... | |
void | ldarg (int indent, string argName) |
Writes the ldarg instruction. Unsing argument names instead of numbers. See ldar(int, int) above More... | |
void | ldarga (int indent, string argName) |
Writes the ldarga instruction, that loads the direction of argument with name argName. More... | |
void | starg (int indent, int argNumber) |
starg <unsigned int16>=""> Take a value from the stack and store it in argument slot number <unsigned int16>="">. The value on the stack must be of the same type as the argument slot or must be convertible to the type of the argument slot. The convertibility rules and effects are the same as those for conversion operations, discussed earlier in this chapter. With vararg methods, the starg instruction cannot target the arguments of the variable part of the signature. More... | |
void | starg (int indent, string argNumber) |
Writes the starg instruction. More... | |
void | arglist (int indent) |
Writes the arglist instruction. More... | |
void | add (int indent) |
Writes the add instruction. More... | |
void | concat (int indent) |
Writes the concat instruction for string types. More... | |
void | mul (int indent) |
Writes the mul instruction. More... | |
void | div (int indent) |
Writes the div instruction. More... | |
void | neg (int indent) |
Writes the neg instruction. More... | |
void | rem (int indent) |
Writes the rem instruction. More... | |
void | sub (int indent) |
Writes the sub instruction. More... | |
void | and (int indent) |
Writes the and instruction. More... | |
void | or (int indent) |
Writes the or instruction. More... | |
void | xor (int indent) |
Writes the xor instruction. More... | |
void | not (int indent) |
Bitwise inversion (unary). This operation, rather than neg, is recommended for integer sign inversion because neg has a problem with the maximum negative numbers: More... | |
override void | Box (int indent, TypeExpression type) |
Writes the Box instruction More... | |
override void | BoxIfNeeded (int indent, TypeExpression type) |
Makes sure to convert a type to an object More... | |
virtual void | UnBoxIfNeeded (int indent, TypeExpression type) |
Convert and OBject to a valuetype if is not an reference type /// More... | |
override void | Unbox (int indent, TypeExpression type) |
Writes the Unbox instruction More... | |
override void | Call (int indent, MethodType memberType, TypeExpression obj, string member) |
Writes the call instruction. More... | |
override void | Call (int indent, PropertyType memberType, TypeExpression obj, string member, bool setProperty) |
Writes the call instruction. More... | |
override void | Call (int indent, string methodType, string result, string klass, string memberName, string[] args) |
Writes the call instruction More... | |
override void | CallVirt (int indent, MethodType memberType, TypeExpression klass, string member, AST.CompoundExpression arguments) |
Writes the CallVirt instruction. More... | |
override void | CallVirt (int indent, PropertyType memberType, TypeExpression obj, string member, bool setProperty) |
Writes the CallVirt instruction. More... | |
override void | CallVirt (int indent, string methodType, string result, string klass, string memberName, string[] args) |
Writes the CallVirt instruction More... | |
void | beq (int indent, string label) |
Writes the beq instruction. More... | |
void | bne (int indent, string label) |
Writes the bne instruction. More... | |
void | bge (int indent, string label) |
Writes the bge instruction. More... | |
void | bgt (int indent, string label) |
Writes the bgt instruction. More... | |
void | ble (int indent, string label) |
Writes the ble instruction. More... | |
void | blt (int indent, string label) |
Writes the blt instruction. More... | |
void | ldci4 (int indent, int val) |
Writes the ldc.i4 instruction. More... | |
void | ldcr8 (int indent, string val) |
Writes the ldc.i8 instruction. More... | |
void | ldc (int indent, bool val) |
Writes the ldc instruction. More... | |
void | ldtoken (int indent, string ILType) |
Writes the ldtoken instruction. More... | |
void | constructorCall (int indent, MethodType memberType, TypeExpression obj, string member) |
Writes the call instruction. More... | |
void | constructorCall (int indent, TypeExpression obj, string member) |
Writes the call instruction. More... | |
void | convToInt (int indent) |
Writes the conv.i4 instruction. More... | |
void | convToChar (int indent) |
Writes the conv.u2 instruction. More... | |
void | convToDouble (int indent) |
Writes the conv.r8 instruction. More... | |
void | ldfld (int indent, TypeExpression type, string classId, string fieldName) |
Writes the ldfld instruction. More... | |
void | ldsfld (int indent, TypeExpression type, string classId, string fieldName) |
Writes the ldsfld instruction. More... | |
void | ldflda (int indent, TypeExpression type, string classId, string fieldName) |
Writes the ldflda instruction. More... | |
void | ldflda (int indent, string token) |
Writes the ldflda instruction. More... | |
void | ldsflda (int indent, TypeExpression type, string classId, string fieldName) |
Writes the ldsflda instruction. More... | |
void | ldsflda (int indent, string token) |
Writes the ldsflda instruction. More... | |
void | stfld (int indent, TypeExpression type, string classId, string fieldName) |
Writes the stfld instruction. More... | |
void | stsfld (int indent, TypeExpression type, string classId, string fieldName) |
Writes the stsfld instruction. More... | |
void | ret (int indent) |
Writes the ret instruction. More... | |
void | ldloc (int indent, int locNumber) |
Writes the ldloc instruction. More... | |
void | ldloc (int indent, string locVar) |
Writes the ldloc instruction. More... | |
void | ldloca (int indent, int locNumber) |
Writes the ldloca instruction. More... | |
void | ldloca (int indent, string locVar) |
Writes the ldloca instruction. More... | |
void | ldloca_s (int indent, string tmpVar) |
loads the content of variable tmpVar in the top of the stack More... | |
void | stloc (int indent, int locNumber) |
Writes the stloc instruction. More... | |
void | stloc_s (int indent, string variable) |
Writes the stloc.s instruction. More... | |
void | stloc (int indent, string locVar) |
Writes the ldloc instruction. More... | |
void | ceq (int indent) |
Writes the ceq instruction. More... | |
void | cgt (int indent) |
Writes the cgt instruction. More... | |
void | clt (int indent) |
Writes the clt instruction. More... | |
void | isinst (int indent, TypeExpression token) |
Writes the isinst instruction. About the isinst Instruction. It takes two arguments: an object reference and a metadata token representing the type of reference desired. It generates code that examines the object's type handle to determine whether or not the object's type is compatible with the requested type. If the test succeeds, it leaves the object reference on the evaluation stack. If the test fails, puts a null reference onto the evaluation stack if the test fails More... | |
void | shl (int indent) |
Writes the shl instruction. More... | |
void | shr (int indent) |
Writes the shr instruction. More... | |
void | nop (int indent) |
Writes a nop instruction. More... | |
void | dup (int indent) |
Writes a dup instruction. More... | |
void | pop (int indent) |
Writes a pop instruction. More... | |
void | WriteLeave (int indentation, string label) |
Write leave.s label More... | |
abstract override void | UnboxAny (int indent, TypeExpression type) |
Writes the Unbox instruction More... | |
void | br (int indent, string label) |
Writes the br instruction. More... | |
void | brfalse (int indent, string label) |
Writes the brfalse instruction. More... | |
void | brtrue (int indent, string label) |
Writes the brtrue instruction. More... | |
virtual void | newarr (int indent, TypeExpression token) |
Writes the newarr instruction. More... | |
virtual void | newarr (int indent, string type) |
Writes the newarr instruction. More... | |
virtual void | ldlen (int indent, TypeExpression token) |
Writes the ldlen instruction. More... | |
virtual void | ldelemInt (int indent) |
Writes the ldelem.i4 instruction. More... | |
virtual void | ldelemChar (int indent) |
Writes the ldelem.u2 instruction. More... | |
virtual void | ldelemDouble (int indent) |
Writes the ldelem.r8 instruction. More... | |
virtual void | ldelemRef (int indent) |
Writes the ldelem.ref instruction. More... | |
virtual void | stelemInt (int indent) |
Writes the stelem.i4 instruction. More... | |
virtual void | stelemDouble (int indent) |
Writes the stelem.r8 instruction. More... | |
virtual void | stelemRef (int indent) |
Writes the stelem.ref instruction. More... | |
void | WriteLine (int indentation, string msg) |
void | WriteLine () |
![]() | |
CodeGenerator (TextWriter writer) | |
Constructor of CodeGenerator. More... | |
virtual void | WriteLNFieldInitialization (string init) |
Writes the field inicialization expression. More... | |
virtual void | WriteCodeOfExceptions () |
Implements Template Method Pattern Writes the intermediate code for each exceptions to include More... | |
virtual void | WriteEntryPoint () |
void | Close () |
Close the writer More... | |
virtual TypeExpression | MakeCall (int indent, InvocationExpression node, Object o, MethodType actualMethodCalled, FieldAccessExpression fieldAccessExpression, object arg) |
Protected Member Functions | |
virtual void | WriteLNMethodEndOfHeader () |
virtual void | WriteMethodModifiers (int indent, MethodType type) |
bool | IsValueType (TypeExpression exp) |
override void | WriteCodeOfExceptionsTemplateMethod (DynamicExceptionManager d) |
Implements Template Method More... | |
virtual void | WriteCallArguments (MethodType memberType, TypeExpression klass, string member, AST.CompoundExpression arguments) |
Writes the 'token' of call instructions. More... | |
virtual void | WriteCall (MethodType memberType, TypeExpression klass, string member, AST.CompoundExpression arguments) |
Writes the 'token' of call instructions. More... | |
Protected Attributes | |
ILStatementsCodeGeneration | ilStamentsCodeGeneration |
![]() | |
TextWriter | output |
Writer to write the intermediate code. More... | |
StringBuilder | currentLocalVars |
Stores the current information about local variables. More... | |
int | currentLabel |
Represents the value of the current label. More... | |
Dictionary< string, DynamicExceptionManager > | exceptions |
List of exceptions that is necessary to include in intermediate code file. More... | |
Properties | |
override string | NewLabel [get] |
int | LocalVariableIndex [get, set] |
![]() | |
abstract string | NewLabel [get] |
Gets the value of the current label More... | |
Definition at line 8 of file ILCodeGenerator.cs.
CodeGeneration.ILCodeGenerator.ILCodeGenerator | ( | TextWriter | output | ) |
Definition at line 39 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.add | ( | int | indent | ) |
Writes the add instruction.
indent | Indentation to use. |
Definition at line 1217 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.AddExceptionCode | ( | DynamicExceptionManager | typeException | ) |
Adds the information of specified exception to include in intermediate code file.
typeException | Exception to include. |
Definition at line 591 of file ILCodeGenerator.cs.
|
virtual |
Stores the information of the local variable.
name | Local variable identifier. |
type | Local variable type. |
Implements CodeGeneration.CodeGenerator.
Definition at line 458 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.and | ( | int | indent | ) |
Writes the and instruction.
indent | Indentation to use. |
Definition at line 1320 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.arglist | ( | int | indent | ) |
Writes the arglist instruction.
indent | Indentation to use. |
Definition at line 1195 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.beq | ( | int | indent, |
string | label | ||
) |
Writes the beq instruction.
indent | Indentation to use. |
label | Label to jump. |
Definition at line 1641 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.bge | ( | int | indent, |
string | label | ||
) |
Writes the bge instruction.
indent | Indentation to use. |
label | Label to jump. |
Definition at line 1673 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.bgt | ( | int | indent, |
string | label | ||
) |
Writes the bgt instruction.
indent | Indentation to use. |
label | Label to jump. |
Definition at line 1689 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.ble | ( | int | indent, |
string | label | ||
) |
Writes the ble instruction.
indent | Indentation to use. |
label | Label to jump. |
Definition at line 1705 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.blt | ( | int | indent, |
string | label | ||
) |
Writes the blt instruction.
indent | Indentation to use. |
label | Label to jump. |
Definition at line 1721 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.bne | ( | int | indent, |
string | label | ||
) |
Writes the bne instruction.
indent | Indentation to use. |
label | Label to jump. |
Definition at line 1657 of file ILCodeGenerator.cs.
|
virtual |
Writes the Box instruction
indent | Indentation to use. |
type | Converts to this object reference. |
Implements CodeGeneration.CodeGenerator.
Definition at line 1384 of file ILCodeGenerator.cs.
|
virtual |
Makes sure to convert a type to an object
indent | Indentation level |
type | The type to be promoted |
Implements CodeGeneration.CodeGenerator.
Definition at line 1393 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.br | ( | int | indent, |
string | label | ||
) |
Writes the br instruction.
indent | Indentation to use. |
label | Label to jump. |
Definition at line 2362 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.brfalse | ( | int | indent, |
string | label | ||
) |
Writes the brfalse instruction.
indent | Indentation to use. |
label | Label to jump. |
Definition at line 2378 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.brtrue | ( | int | indent, |
string | label | ||
) |
Writes the brtrue instruction.
indent | Indentation to use. |
label | Label to jump. |
Definition at line 2394 of file ILCodeGenerator.cs.
|
virtual |
Writes the call instruction.
indent | Indentation to use. |
memberType | Member type. |
obj | Object to access to the member. |
member | Member to call. |
Implements CodeGeneration.CodeGenerator.
Definition at line 1489 of file ILCodeGenerator.cs.
|
virtual |
Writes the call instruction.
indent | Indentation to use. |
memberType | Member type. |
obj | Object to access to the member. |
member | Member to call. |
setProperty | True if it is a set property. False if it is a get property. |
Implements CodeGeneration.CodeGenerator.
Definition at line 1503 of file ILCodeGenerator.cs.
|
virtual |
Writes the call instruction
indent | Text Indentation |
methodType | Qualifiers of the method |
result | Return type |
klass | Class type |
memberName | Name of the member |
args | Types of parameters |
Implements CodeGeneration.CodeGenerator.
Definition at line 1519 of file ILCodeGenerator.cs.
|
virtual |
Writes the CallVirt instruction.
indent | Indentation to use. |
memberType | Member type. |
klass | Class to access to the member. |
member | Member to call. |
arguments | Actual arguments |
Implements CodeGeneration.CodeGenerator.
Definition at line 1541 of file ILCodeGenerator.cs.
|
virtual |
Writes the CallVirt instruction.
indent | Indentation to use. |
memberType | Member type. |
obj | Object to access to the member. |
member | Member to call. |
setProperty | True if it is a set property. False if it is a get property. |
Implements CodeGeneration.CodeGenerator.
Definition at line 1555 of file ILCodeGenerator.cs.
|
virtual |
Writes the CallVirt instruction
indent | Text Indentation |
methodType | Qualifiers of the method |
result | Return type |
klass | Class type |
memberName | Name of the member |
args | Types of parameters |
Implements CodeGeneration.CodeGenerator.
Definition at line 1571 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.castclass | ( | int | indent, |
TypeExpression | token | ||
) |
Writes the castclass instruction.
indent | Indentation to use. |
token | Type of the new instance. |
Definition at line 1095 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.ceq | ( | int | indent | ) |
Writes the ceq instruction.
indent | Indentation to use. |
Definition at line 2171 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.cgt | ( | int | indent | ) |
Writes the cgt instruction.
indent | Indentation to use. |
Definition at line 2188 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.clt | ( | int | indent | ) |
Writes the clt instruction.
indent | Indentation to use. |
Definition at line 2203 of file ILCodeGenerator.cs.
|
virtual |
Writes the specified message as a comment in il language
msg | Message to write. |
Implements CodeGeneration.CodeGenerator.
Definition at line 78 of file ILCodeGenerator.cs.
|
virtual |
Writes the specified message stored in msg in a comment wrapped in the proper format of the target langage.
msg | comment to write. |
indent | indentation to use |
Implements CodeGeneration.CodeGenerator.
Definition at line 87 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.concat | ( | int | indent | ) |
Writes the concat instruction for string types.
indent | Indentation to use. |
Definition at line 1225 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.constructorCall | ( | int | indent, |
MethodType | memberType, | ||
TypeExpression | obj, | ||
string | member | ||
) |
Writes the call instruction.
indent | Indentation to use. |
memberType | Member type. |
obj | Object to access to the member. |
member | Member to call. |
Definition at line 1808 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.constructorCall | ( | int | indent, |
TypeExpression | obj, | ||
string | member | ||
) |
Writes the call instruction.
indent | Indentation to use. |
obj | Object to access to the member. |
member | Member to call. |
Definition at line 1820 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.convToChar | ( | int | indent | ) |
Writes the conv.u2 instruction.
indent | Indentation to use. |
Definition at line 1853 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.convToDouble | ( | int | indent | ) |
Writes the conv.r8 instruction.
indent | Indentation to use. |
Definition at line 1869 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.convToInt | ( | int | indent | ) |
Writes the conv.i4 instruction.
indent | Indentation to use. |
Definition at line 1838 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.div | ( | int | indent | ) |
Writes the div instruction.
indent | Indentation to use. |
Definition at line 1255 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.dup | ( | int | indent | ) |
Writes a dup instruction.
indent | Indentation to use. |
Definition at line 2300 of file ILCodeGenerator.cs.
|
virtual |
Checks if the union type can to promote to the specified type.
indent | Indentation to write. |
union | Union type to check. |
type | WriteType to promote. |
generates exit environment function of the OS
indent | |
res | Code to return to the operative system |
Definition at line 646 of file ILCodeGenerator.cs.
|
virtual |
Displays de comment to show in the first line of il file.
Implements CodeGeneration.CodeGenerator.
Definition at line 51 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.isinst | ( | int | indent, |
TypeExpression | token | ||
) |
Writes the isinst instruction. About the isinst Instruction. It takes two arguments: an object reference and a metadata token representing the type of reference desired. It generates code that examines the object's type handle to determine whether or not the object's type is compatible with the requested type. If the test succeeds, it leaves the object reference on the evaluation stack. If the test fails, puts a null reference onto the evaluation stack if the test fails
indent | Indentation to use. |
token | Type of the new instance. |
Definition at line 2225 of file ILCodeGenerator.cs.
|
protected |
Definition at line 806 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.ldarg | ( | int | indent, |
int | argNumber | ||
) |
ldarg <unsigned int16>=""> Load the argument number <unsigned int16>=""> on the stack. The argument enumeration is zero-based, but it’s important to remember that instance methods have an 'invisible' argument not specified in the method signature: the class instance pointer, this, which is always argument number 0. Because static methods don’t have such an 'invisible' argument, for them argument number 0 is the first argument specified in
indent | Indentation to use. |
argNumber | Argument number to load. |
Definition at line 1131 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.ldarg | ( | int | indent, |
string | argName | ||
) |
Writes the ldarg instruction. Unsing argument names instead of numbers. See ldar(int, int) above
indent | Indentation to use. |
argName | Argument name to load. |
Definition at line 1140 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.ldarga | ( | int | indent, |
string | argName | ||
) |
Writes the ldarga instruction, that loads the direction of argument with name argName.
indent | Indentation to use. |
argName | Argument name to load. |
Definition at line 1152 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.ldc | ( | int | indent, |
bool | val | ||
) |
Writes the ldc instruction.
indent | Indentation to use. |
val | Value to load if true ldc. |
Definition at line 1775 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.ldci4 | ( | int | indent, |
int | val | ||
) |
Writes the ldc.i4 instruction.
indent | Indentation to use. |
val | Value to load. |
Definition at line 1741 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.ldcr8 | ( | int | indent, |
string | val | ||
) |
Writes the ldc.i8 instruction.
indent | Indentation to use. |
val | Value to load. |
Definition at line 1760 of file ILCodeGenerator.cs.
|
virtual |
Writes the ldelem.u2 instruction.
indent | Indentation to use. |
Definition at line 2464 of file ILCodeGenerator.cs.
|
virtual |
Writes the ldelem.r8 instruction.
indent | Indentation to use. |
Definition at line 2476 of file ILCodeGenerator.cs.
|
virtual |
Writes the ldelem.i4 instruction.
indent | Indentation to use. |
Definition at line 2456 of file ILCodeGenerator.cs.
|
virtual |
Writes the ldelem.ref instruction.
indent | Indentation to use. |
Definition at line 2487 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.ldfld | ( | int | indent, |
TypeExpression | type, | ||
string | classId, | ||
string | fieldName | ||
) |
Writes the ldfld instruction.
indent | Indentation to use. |
type | Field type. |
classId | Class identifier of the field. |
fieldName | Field identifier. |
ldfld NS.Class::field
Definition at line 1894 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.ldflda | ( | int | indent, |
TypeExpression | type, | ||
string | classId, | ||
string | fieldName | ||
) |
Writes the ldflda instruction.
indent | Indentation to use. |
type | Field type. |
classId | Class identifier of the field. |
fieldName | Field identifier. |
Definition at line 1945 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.ldflda | ( | int | indent, |
string | token | ||
) |
Writes the ldflda instruction.
indent | Indentation to use. |
token | Full field specification |
Definition at line 1954 of file ILCodeGenerator.cs.
|
virtual |
Writes the ldlen instruction.
indent | Indentation to use. |
TODO: para qué sirve el parámetro token?
Definition at line 2441 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.ldloc | ( | int | indent, |
int | locNumber | ||
) |
Writes the ldloc instruction.
indent | Indentation to use. |
locNumber | Local variable number to load. |
Definition at line 2071 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.ldloc | ( | int | indent, |
string | locVar | ||
) |
Writes the ldloc instruction.
indent | Indentation to use. |
locNumber | Local variable to load. |
Definition at line 2080 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.ldloca | ( | int | indent, |
int | locNumber | ||
) |
Writes the ldloca instruction.
indent | Indentation to use. |
locNumber | Local variable number to load. |
Definition at line 2097 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.ldloca | ( | int | indent, |
string | locVar | ||
) |
Writes the ldloca instruction.
indent | Indentation to use. |
locVar | Local variable to load. |
Definition at line 2106 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.ldloca_s | ( | int | indent, |
string | tmpVar | ||
) |
loads the content of variable tmpVar in the top of the stack
tmpVar | var to be dumped in the top of the stack |
Definition at line 2114 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.ldnull | ( | int | indent | ) |
Writes the ldnull instruction.
indent | Indentation to use. |
Definition at line 1039 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.ldobj | ( | int | indent, |
TypeExpression | val | ||
) |
Writes the ldobj instruction.
indent | Indentation to use. |
val | Value to load. |
Definition at line 1006 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.ldsfld | ( | int | indent, |
TypeExpression | type, | ||
string | classId, | ||
string | fieldName | ||
) |
Writes the ldsfld instruction.
indent | Indentation to use. |
type | Field type. |
classId | Class identifier of the field. |
fieldName | Field identifier. |
Definition at line 1922 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.ldsflda | ( | int | indent, |
TypeExpression | type, | ||
string | classId, | ||
string | fieldName | ||
) |
Writes the ldsflda instruction.
indent | Indentation to use. |
type | Field type. |
classId | Class identifier of the field. |
fieldName | Field identifier. |
Definition at line 1969 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.ldsflda | ( | int | indent, |
string | token | ||
) |
Writes the ldsflda instruction.
indent | Indentation to use. |
token | Full field specification |
Definition at line 1978 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.ldstr | ( | int | indent, |
string | val | ||
) |
Writes the ldstr instruction.
indent | Indentation to use. |
val | Value to load. |
Definition at line 1022 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.ldtoken | ( | int | indent, |
string | ILType | ||
) |
Writes the ldtoken instruction.
indent | Indentation to use. |
ILType | Representation of the IL type. |
Definition at line 1790 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.mul | ( | int | indent | ) |
Writes the mul instruction.
indent | Indentation to use. |
Definition at line 1240 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.neg | ( | int | indent | ) |
Writes the neg instruction.
indent | Indentation to use. |
Definition at line 1270 of file ILCodeGenerator.cs.
|
virtual |
Writes the newarr instruction.
indent | Indentation to use. |
token | WriteType of the vector elements. |
Definition at line 2414 of file ILCodeGenerator.cs.
|
virtual |
Writes the newarr instruction.
indent | Indentation to use. |
type | String representation of a type. |
Definition at line 2425 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.newobj | ( | int | indent, |
MethodType | memberType, | ||
TypeExpression | obj, | ||
string | member | ||
) |
Writes the newobj instruction.
indent | Indentation to use. |
memberType | Member type. |
obj | Object to access to the member. |
member | Member to call. |
Definition at line 1060 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.newobj | ( | int | indent, |
string | klass, | ||
string[] | args | ||
) |
Writes the newobj instruction
indent | Text Indentation |
klass | Class type |
args | Types of parameters |
Definition at line 1075 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.nop | ( | int | indent | ) |
Writes a nop instruction.
indent | Indentation to use. |
Definition at line 2284 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.not | ( | int | indent | ) |
Bitwise inversion (unary). This operation, rather than neg, is recommended for integer sign inversion because neg has a problem with the maximum negative numbers:
indent | Indentation to use. |
Definition at line 1364 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.or | ( | int | indent | ) |
Writes the or instruction.
indent | Indentation to use. |
Definition at line 1335 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.pop | ( | int | indent | ) |
Writes a pop instruction.
indent | Indentation to use. |
Definition at line 2316 of file ILCodeGenerator.cs.
|
virtual |
Definition at line 238 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.Promotion | ( | int | indent, |
TypeExpression | typeExp1, | ||
TypeExpression | certainType1, | ||
TypeExpression | typeExp2, | ||
TypeExpression | certainType2, | ||
bool | unidirectionalConversion, | ||
bool | makeBoxing | ||
) |
Writes the il code to promote typeExp1 to typeExp2
typeExp1 | The type of the element that is in the stack |
typeExp2 | The type to promote to |
Definition at line 659 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.rem | ( | int | indent | ) |
Writes the rem instruction.
indent | Indentation to use. |
Definition at line 1284 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.ret | ( | int | indent | ) |
Writes the ret instruction.
indent | Indentation to use. |
Definition at line 2050 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.shl | ( | int | indent | ) |
Writes the shl instruction.
indent | Indentation to use. |
Definition at line 2249 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.shr | ( | int | indent | ) |
Writes the shr instruction.
indent | Indentation to use. |
Definition at line 2264 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.starg | ( | int | indent, |
int | argNumber | ||
) |
starg <unsigned int16>=""> Take a value from the stack and store it in argument slot number <unsigned int16>="">. The value on the stack must be of the same type as the argument slot or must be convertible to the type of the argument slot. The convertibility rules and effects are the same as those for conversion operations, discussed earlier in this chapter. With vararg methods, the starg instruction cannot target the arguments of the variable part of the signature.
indent | Indentation to use. |
argNumber | Argument number to store. |
Definition at line 1171 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.starg | ( | int | indent, |
string | argNumber | ||
) |
Writes the starg instruction.
indent | Indentation to use. |
argNumber | Argument name to store. |
Definition at line 1180 of file ILCodeGenerator.cs.
|
virtual |
Writes the stelem.r8 instruction.
indent | Indentation to use. |
Definition at line 2513 of file ILCodeGenerator.cs.
|
virtual |
Writes the stelem.i4 instruction.
indent | Indentation to use. |
Definition at line 2502 of file ILCodeGenerator.cs.
|
virtual |
Writes the stelem.ref instruction.
indent | Indentation to use. |
Definition at line 2524 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.stfld | ( | int | indent, |
TypeExpression | type, | ||
string | classId, | ||
string | fieldName | ||
) |
Writes the stfld instruction.
indent | Indentation to use. |
type | Field type. |
classId | Class identifier of the field. |
fieldName | Field identifier. |
Definition at line 1997 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.stloc | ( | int | indent, |
int | locNumber | ||
) |
Writes the stloc instruction.
indent | Indentation to use. |
locNumber | Local variable number to store. |
Definition at line 2132 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.stloc | ( | int | indent, |
string | locVar | ||
) |
Writes the ldloc instruction.
indent | Indentation to use. |
locVar | Local variable to store. |
Definition at line 2151 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.stloc_s | ( | int | indent, |
string | variable | ||
) |
Writes the stloc.s instruction.
indent | Indentation to use. |
variable | variable to store. |
Definition at line 2141 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.stsfld | ( | int | indent, |
TypeExpression | type, | ||
string | classId, | ||
string | fieldName | ||
) |
Writes the stsfld instruction.
indent | Indentation to use. |
type | Field type. |
classId | Class identifier of the field. |
fieldName | Field identifier. |
Definition at line 2023 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.sub | ( | int | indent | ) |
Writes the sub instruction.
indent | Indentation to use. |
Definition at line 1300 of file ILCodeGenerator.cs.
|
virtual |
Writes the Unbox instruction
indent | Indentation to use. |
type | Value type to revert. |
Implements CodeGeneration.CodeGenerator.
Definition at line 1418 of file ILCodeGenerator.cs.
|
pure virtual |
Writes the Unbox instruction
indent | Indentation to use. |
type | Value type to revert. |
Implements CodeGeneration.CodeGenerator.
Implemented in CodeGeneration.CLRCodeGenerator, and CodeGeneration.RrotorCodeGenerator.
|
virtual |
Convert and OBject to a valuetype if is not an reference type ///
indent | Indentation level |
type | The type to be promoted |
Definition at line 1406 of file ILCodeGenerator.cs.
|
virtual |
Writes the information of local variables.
indent | Current indentation. |
id | Auxiliar local variable identifier. |
type | Auxiliar local variable type expression. |
Implements CodeGeneration.CodeGenerator.
Definition at line 491 of file ILCodeGenerator.cs.
|
protectedvirtual |
Writes the 'token' of call instructions.
memberType | Member type (null when the implicit object is a fresh type variable). |
klass | WriteType of the object to access to the member. |
member | Member to call. |
arguments | Actual arguments. This parameter is only necessary when the "memberType" parameter may be null. |
Definition at line 1589 of file ILCodeGenerator.cs.
|
protectedvirtual |
Writes the 'token' of call instructions.
memberType | Member type (null when the implicit object is a fresh type variable). |
klass | WriteType of the object to access to the member. |
member | Member to call. |
arguments | Actual arguments. This parameter is only necessary when the "memberType" parameter may be null. |
Definition at line 1439 of file ILCodeGenerator.cs.
|
virtual |
Implements CodeGeneration.CodeGenerator.
Definition at line 531 of file ILCodeGenerator.cs.
|
virtual |
Definition at line 154 of file ILCodeGenerator.cs.
|
virtual |
Definition at line 165 of file ILCodeGenerator.cs.
|
virtual |
Definition at line 146 of file ILCodeGenerator.cs.
|
virtual |
Implements CodeGeneration.CodeGenerator.
Definition at line 540 of file ILCodeGenerator.cs.
|
virtual |
Implements CodeGeneration.CodeGenerator.
Definition at line 557 of file ILCodeGenerator.cs.
|
virtual |
Implements CodeGeneration.CodeGenerator.
Definition at line 519 of file ILCodeGenerator.cs.
|
protectedvirtual |
Implements Template Method
d | An TypeSsystem Mananager to exception to use |
Implements CodeGeneration.CodeGenerator.
Definition at line 826 of file ILCodeGenerator.cs.
|
virtual |
Writes the termination token
indent | Indentation to use. |
Implements CodeGeneration.CodeGenerator.
Definition at line 290 of file ILCodeGenerator.cs.
|
virtual |
Writes the class termination acoording to IL code
indent | Indentation to use. |
name | Name of the class to terminate. |
Implements CodeGeneration.CodeGenerator.
Definition at line 207 of file ILCodeGenerator.cs.
|
virtual |
Writes the field termination
Implements CodeGeneration.CodeGenerator.
Definition at line 266 of file ILCodeGenerator.cs.
|
virtual |
Writes the interface termination
indent | Indentation to use. |
name | Name of the interface to terminate. |
Implements CodeGeneration.CodeGenerator.
Definition at line 229 of file ILCodeGenerator.cs.
|
virtual |
Writes the method termination. It writes also en end of line
indent | Indentation to use. |
name | Name of the method to terminate. |
Implements CodeGeneration.CodeGenerator.
Definition at line 423 of file ILCodeGenerator.cs.
|
virtual |
Writes the entrypoint directive.
indent | Indentation to use. |
Implements CodeGeneration.CodeGenerator.
Definition at line 501 of file ILCodeGenerator.cs.
|
virtual |
Writes the field header.
indent | Indentation to use. |
name | Field name. |
type | Field type expression. |
constantField | True if the field is a constant. Otherwise, false. |
Implements CodeGeneration.CodeGenerator.
Definition at line 247 of file ILCodeGenerator.cs.
|
virtual |
Implements CodeGeneration.CodeGenerator.
Definition at line 549 of file ILCodeGenerator.cs.
|
virtual |
Writes the header of the il code file.
fileName | Name of the module. |
Implements CodeGeneration.CodeGenerator.
Definition at line 121 of file ILCodeGenerator.cs.
|
virtual |
Writes the interface header
indent | Indentation to use. |
name | Interface name. |
type | Interface type expression. |
Implements CodeGeneration.CodeGenerator.
Definition at line 217 of file ILCodeGenerator.cs.
|
virtual |
Writes a label in il. Format –indentation– LABEL:
label | text of the label |
Implements CodeGeneration.CodeGenerator.
Definition at line 97 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.WriteLeave | ( | int | indentation, |
string | label | ||
) |
Write leave.s label
indentation | |
label | label to write |
Definition at line 2330 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.WriteLine | ( | int | indentation, |
string | msg | ||
) |
Definition at line 2543 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.WriteLine | ( | ) |
Definition at line 2558 of file ILCodeGenerator.cs.
|
virtual |
Writes the class header in IL code
indent | Indentation to use. |
name | Class name. |
type | Class type expression. |
Implements CodeGeneration.CodeGenerator.
Definition at line 190 of file ILCodeGenerator.cs.
|
virtual |
Writes the field inicialization.
type | WriteType Expression of the field inicialization. |
Implements CodeGeneration.CodeGenerator.
Definition at line 255 of file ILCodeGenerator.cs.
|
protectedvirtual |
Definition at line 330 of file ILCodeGenerator.cs.
|
virtual |
Writes the method header.
indent | Indentation to use. |
name | Method name. |
type | Method type expression. |
Implements CodeGeneration.CodeGenerator.
Definition at line 321 of file ILCodeGenerator.cs.
|
virtual |
Writes the information of local variables.
indent | Current indentation. |
Implements CodeGeneration.CodeGenerator.
Definition at line 474 of file ILCodeGenerator.cs.
|
protectedvirtual |
Definition at line 337 of file ILCodeGenerator.cs.
|
virtual |
Definition at line 406 of file ILCodeGenerator.cs.
|
virtual |
Definition at line 365 of file ILCodeGenerator.cs.
|
virtual |
Writes the namespace header of an IL file.
indent | Indentation to use. |
name | Namespace name. |
Implements CodeGeneration.CodeGenerator.
Definition at line 135 of file ILCodeGenerator.cs.
|
virtual |
Implements CodeGeneration.CodeGenerator.
Definition at line 535 of file ILCodeGenerator.cs.
|
virtual |
Implements CodeGeneration.CodeGenerator.
Definition at line 553 of file ILCodeGenerator.cs.
|
virtual |
Implements CodeGeneration.CodeGenerator.
Definition at line 515 of file ILCodeGenerator.cs.
|
virtual |
Writes the parameters of a method
memberType | The type of the method |
s
arguments | Actual arguments |
Implements CodeGeneration.CodeGenerator.
Definition at line 435 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.WriteRethrow | ( | int | indent | ) |
Definition at line 523 of file ILCodeGenerator.cs.
|
virtual |
Writes the block inicialization
indent | Indentation to use. |
Implements CodeGeneration.CodeGenerator.
Definition at line 278 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.WriteThrow | ( | int | indent | ) |
Writes the throw instruction.
indent | Indentation to use. |
Definition at line 1109 of file ILCodeGenerator.cs.
|
virtual |
Writes the generation code to throw a specified exception.
Converts a fresh type variable on the stack (object) to another type
indent | Indentation level |
typeExpression | The type expression to promote to |
indent | Identation to use. |
dynException | Exception to throw. |
Implements CodeGeneration.CodeGenerator.
Definition at line 975 of file ILCodeGenerator.cs.
|
virtual |
Writes the code to throw an exception derived from Exception without using DynamicExceptionManager .
indent | indentation to use |
ex | Name of the exception to throw |
type args | an array with the type name of the arguments of the constructor exception. If the list is empty there won't be code generation about this param |
Implements CodeGeneration.CodeGenerator.
Definition at line 986 of file ILCodeGenerator.cs.
|
virtual |
Definition at line 564 of file ILCodeGenerator.cs.
|
virtual |
Definition at line 581 of file ILCodeGenerator.cs.
|
virtual |
Implements CodeGeneration.CodeGenerator.
Definition at line 511 of file ILCodeGenerator.cs.
|
virtual |
Writes the current type information
type | WriteType expression with the type information. |
Implements CodeGeneration.CodeGenerator.
Definition at line 109 of file ILCodeGenerator.cs.
void CodeGeneration.ILCodeGenerator.xor | ( | int | indent | ) |
Writes the xor instruction.
indent | Indentation to use. |
Definition at line 1350 of file ILCodeGenerator.cs.
|
protected |
Definition at line 11 of file ILCodeGenerator.cs.
|
getset |
Definition at line 30 of file ILCodeGenerator.cs.
|
get |
Definition at line 17 of file ILCodeGenerator.cs.