The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
CGInterfaceDefinitionStartOperation.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 CGInterfaceDefinitionStartOperation<T> : TypeSystemOperation where T: ILCodeGenerator{
13 
17  private T codeGenerator;
21  private int indent;
25  private InterfaceDefinition node;
31  public CGInterfaceDefinitionStartOperation(T codeGenerator, int indent, InterfaceDefinition node) {
32  this.codeGenerator = codeGenerator;
33  this.indent = indent;
34  this.node = node;
35  }
41  public override object Exec(InterfaceType it, object arg) {
42  // In the following call the last argument could beor node.TypeExpr, but is the same of
43  // the argument due to the dispatcher call
44  this.codeGenerator.WriteInterfaceHeader(this.indent, node.Identifier, it);
45  this.codeGenerator.WriteStartBlock(this.indent);
46  return null;
47  }
53  public override object Exec(TypeExpression t, object arg) {
54  ErrorManager.Instance.NotifyError(new UserTypeExpectedError(node.Location));
55  return null;
56  }
57 
58  }
59 }
This class represent the entry wnen sending a message to an operation object derived from TypeExpress...
Represents a interface type.
Abstract class that represents all different types.
Encapsulates a definition of a concrete interface.
Represents a error produced when user type is expected but do not found.