The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
CGClassDefinitionStartOperation.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 CGClassDefinitionStartOperation<T> : TypeSystemOperation where T : ILCodeGenerator {
13 
17  private T codeGenerator;
21  private int indent;
25  private ClassDefinition node;
31  public CGClassDefinitionStartOperation(T codeGenerator, int indent, ClassDefinition node) {
32  this.codeGenerator = codeGenerator;
33  this.indent = indent;
34  this.node = node;
35  }
41  public override object Exec(ClassType ct, 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.WriteLNClassHeader(this.indent, node.Identifier, ct);
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(this.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...
Abstract class that represents all different types.
Represents a error produced when user type is expected but do not found.
Represents a class type.
Definition: ClassType.cs:35
Encapsulates a definition of a concrete class.