1 using TypeSystem.Operations;
3 namespace CodeGeneration.Operations {
7 internal class CGLoadArrayElementOperation<T> :
TypeSystemOperation where T : ILCodeGenerator {
12 private T codeGenerator;
19 public CGLoadArrayElementOperation(T codeGenerator,
int indent) {
20 this.codeGenerator = codeGenerator;
23 public override object Exec(
ClassType ct,
object arg) {
24 this.codeGenerator.ldelemRef(this.indent);
27 public override object Exec(
StringType s,
object arg) {
28 this.codeGenerator.ldelemRef(this.indent);
31 public override object Exec(
ArrayType a,
object arg) {
32 this.codeGenerator.ldelemRef(this.indent);
38 this.codeGenerator.ldelemRef(
this.indent);
40 this.codeGenerator.CallVirt(this.indent,
"instance",
"class [mscorlib]System.Object",
"class [mscorlib]System.Array",
"GetValue",
new string[] {
"int32" });
44 public override object Exec(
UnionType t,
object arg) {
45 this.codeGenerator.ldelemRef(this.indent);
48 public override object Exec(
DoubleType d,
object arg) {
49 this.codeGenerator.ldelemDouble(this.indent);
52 public override object Exec(
CharType c,
object arg)
54 this.codeGenerator.ldelemChar(this.indent);
58 this.codeGenerator.ldelemInt(this.indent);
Representa an array type.
This class represent the entry wnen sending a message to an operation object derived from TypeExpress...
Represent a character type.
Abstract class that represents all different types.
Represents a generic type expression
abstract bool IsValueType()
True if type expression is a ValueType. Otherwise, false.
Represents a double type.
TypeExpression Substitution
Gets the substitution; null if it does not exist