The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
CGProcessMethodOperation.cs
Go to the documentation of this file.
1 using TypeSystem.Operations;
2 using TypeSystem;
3 using ErrorManagement;
4 using AST;
5 using Tools;
6 using System.Collections.Generic;
7 using CodeGeneration.ExceptionManagement;
8 namespace CodeGeneration.Operations {
12  internal class CGProcessMethodOperation<T> : TypeSystemOperation where T : ILCodeGenerator {
13 
17  private T codeGenerator;
21  private int indentation;
25 
26  private MethodDeclaration node;
27  private object argument;
35  public CGProcessMethodOperation(T codeGenerator, int indentation, MethodDeclaration node, object argument) {
36  this.codeGenerator = codeGenerator;
37  this.indentation = indentation;
38  this.node = node;
39  this.argument = argument;
40  }
46  public override object Exec(MethodType m, object arg) {
47  this.codeGenerator.WriteLNMethodHeader(this.indentation, m.MemberInfo.MemberIdentifier, m);
48  return null;
49  }
55  public override object Exec(TypeExpression t, object arg) {
56  ErrorManager.Instance.NotifyError(new MemberTypeExpectedError(node.Location));
57  return null;
58  }
59 
60  }
61 }
Represents a error produced when member type is expected but do not found.
This class represent the entry wnen sending a message to an operation object derived from TypeExpress...
Abstract class that represents all different types.
Encapsulates a declaration of a concrete method.
Representa a method type.
Definition: MethodType.cs:37