6 namespace CodeGeneration.Operations {
9 internal class CGILInvocationExpressionOperation<T> :
AstOperation where T : CLRCodeGenerator {
14 private T codeGenerator;
19 private VisitorCLRCodeGeneration<T> visitor;
29 InheritedAttributes inheritedAttributes;
31 InheritedAttributes objInv;
35 public CGILInvocationExpressionOperation(
int indent, VisitorCLRCodeGeneration<T> visitor,
37 InheritedAttributes inheritedAttributes, InheritedAttributes objInv,
object objArgs) {
39 this.visitor = visitor;
40 this.codeGenerator = codeGenerator;
42 this.inheritedAttributes = inheritedAttributes;
44 this.objArgs = objArgs;
51 return caller.AcceptOperation(
new CGILMethodInvocationOperation<T>(
52 this.indent, this.visitor, this.codeGenerator, this.node,
53 this.inheritedAttributes, this.objArgs, this.objInv), arg);
55 throw new FieldAccessException();
62 if ( ( ( (
MethodType)node.ActualMethodCalled ).MemberInfo.ModifierMask &
Modifier.Static ) == 0 )
63 this.codeGenerator.ldarg(
this.indent, 0);
64 this.node.Arguments.Accept(this.visitor, this.objArgs);
65 this.codeGenerator.Call(this.indent, actualMethodCalled, actualMethodCalled.MemberInfo.Class, s.Identifier);
68 this.codeGenerator.UnboxAny(this.indent, node.ExpressionType);
76 this.node.Arguments.Accept(this.visitor, this.objArgs);
77 this.codeGenerator.constructorCall(this.indent, actualMethodCalled, b.ExpressionType,
".ctor");
82 public override object Exec(
AstNode a,
object arg) {
83 this.codeGenerator.WriteLine(this.indent,
"//entro por AstNode");
Encapsulates a 'base' expression.
Encapsulates the expression to access a field.
Encapsulates a invocation expression.
override bool IsFreshVariable()
To know if it is a type variable with no substitution
This class represent the entry wnen sending a message to an operation object. derived from AstNode ...
Abstract class that represents all different types.
Represents a generic type expression
Encapsulates a identifier expression of our programming language.
Abstract class for all nodes that compounds the abstract syntax tree.
Modifier
Indicates differents modifiers to use in class (only public, internal or static), fields or methods...
Representa a method type.