The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
CGProcessFieldOperation.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 CGProcessFieldOperation<T> : TypeSystemOperation where T : ILCodeGenerator {
13 
17  private T codeGenerator;
18 
22  private int indentation;
26  private FieldDeclaration node;
30  private bool constantField;
34  private object argument;
35 
44  public CGProcessFieldOperation(T codeGenerator, int indentation, FieldDeclaration node,
45  bool constantField, object argument) {
46  this.codeGenerator = codeGenerator;
47  this.indentation = indentation;
48  this.node = node;
49  this.constantField = constantField;
50  this.argument = argument;
51  }
57  public override object Exec(FieldType f, object arg) {
58  this.codeGenerator.ProcessField(this.indentation, this.node, this.argument, this.constantField);
59  return null;
60  }
66  public override object Exec(TypeExpression t, object arg) {
67  ErrorManager.Instance.NotifyError(new MemberTypeExpectedError(node.Location));
68  return null;
69  }
70 
71  }
72 }
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 field.
Representa a field type.
Definition: FieldType.cs:37