The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
CGRemoveTopElementInvocationOperation.cs
Go to the documentation of this file.
1 using TypeSystem.Operations;
2 using TypeSystem;
3 namespace CodeGeneration.Operations {
7  internal class CGRemoveTopElementInvocationOperation : TypeSystemOperation {
8 
9  public CGRemoveTopElementInvocationOperation() { }
15  public override object Exec(VoidType v, object arg) {
16  return false;
17  }
23  public override object Exec(UnionType ut, object arg) {
24  return !(ut.TypeSet[0] is VoidType);
25  }
26 
27  public override object Exec(TypeVariable t, object arg) {
28  if ( t.IsFreshVariable() )
29  return true; //It is an introspective method call
30  return t.Substitution.AcceptOperation(this, arg);
31  }
37  public override object Exec(TypeExpression t, object arg) {
38  return true;
39  }
40  }
41 }
Representa a union type.
Definition: UnionType.cs:36
This class represent the entry wnen sending a message to an operation object derived from TypeExpress...
override bool IsFreshVariable()
To know if it is a type variable with no substitution
Represents a void type.
Definition: VoidType.cs:34
Abstract class that represents all different types.
Represents a generic type expression
Definition: TypeVariable.cs:36