The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
TypeSystemOperations.cs
Go to the documentation of this file.
1 using ErrorManagement;
2 using TypeSystem;
3 using System;
4 
5 
6 namespace TypeSystem.Operations {
10  public abstract class TypeSystemOperation {
11  public virtual bool IsBinary() { return true; }
12  public virtual object Exec(ArrayType a, object arg) { return Exec((TypeExpression)a, arg); }
13  public virtual object Exec(BCLClassType b, object arg) { return Exec((ClassType)b, arg); }
14  public virtual object Exec(BCLInterfaceType b, object arg) { return Exec((InterfaceType)b, arg); }
15  public virtual object Exec(BoolType b, object arg) { return Exec((TypeExpression)b, arg); }
16  public virtual object Exec(CharType c, object arg) { return Exec((TypeExpression)c, arg); }
17  public virtual object Exec(ClassType c, object arg) { return Exec((UserType)c, arg); }
18  public virtual object Exec(ClassTypeProxy c, object arg) { return Exec((TypeExpression)c, arg); }
19  public virtual object Exec(DoubleType d, object arg) { return Exec((TypeExpression)d, arg); }
20  public virtual object Exec(FieldType g, object arg) { return Exec((TypeExpression)g, arg); }
21  public virtual object Exec(InterfaceType i, object arg) { return Exec((UserType)i, arg); }
22  public virtual object Exec(IntersectionType i, object arg) { return Exec((TypeExpression)i, arg); }
23  public virtual object Exec(IntType i, object arg) { return Exec((TypeExpression)i, arg); }
24  public virtual object Exec(MethodType m, object arg) { return Exec((TypeExpression)m, arg); }
25  public virtual object Exec(NullType n, object arg) { return Exec((TypeExpression)n, arg); }
26  public virtual object Exec(PropertyType p, object arg) { return Exec((TypeExpression)p, arg); }
27  public virtual object Exec(StringType s, object arg) { return Exec((TypeExpression)s, arg); }
28  public virtual object Exec(TypeExpression t, object arg) { return ReportError(t); }
29  public virtual object Exec(TypeVariable t, object arg) { return Exec((TypeExpression)t, arg); }
30  public virtual object Exec(UnionType u, object arg) { return Exec((TypeExpression)u, arg); }
31  public virtual object Exec(UserType u, object arg) { return Exec((TypeExpression)u, arg); }
32  public virtual object Exec(VoidType v, object arg) { return Exec((TypeExpression)v, arg); }
33 
34  public virtual object ReportError(String operation, TypeExpression typeExpression, Location location) {
35  ErrorManager.Instance.NotifyError(new InternalOperationInterfaceError(operation, typeExpression.FullName, location));
36  return null;
37 
38  }
39 
40  public virtual object ReportError(String operation, TypeExpression typeExpression) {
41  return ReportError(operation, typeExpression, new Location());
42  }
43 
44  public virtual object ReportError(TypeExpression typeExpression) {
45  ErrorManager.Instance.NotifyError(new InternalOperationInterfaceError("Unknown TypeSystemOperation", typeExpression.FullName, new Location()));
46  return null;
47  }
48 
49  }
50 }
virtual object Exec(IntType i, object arg)
virtual object Exec(MethodType m, object arg)
Representa a union type.
Definition: UnionType.cs:36
Representa an array type.
Definition: ArrayType.cs:35
virtual object Exec(PropertyType p, object arg)
Represent a string type.
Definition: StringType.cs:36
This class encapsulates a location in a specific file. Implements an Inmutable pattern. So it can be used in any context, that is his internal fields never change.
Definition: Location.cs:24
This class represent the entry wnen sending a message to an operation object derived from TypeExpress...
virtual object Exec(VoidType v, object arg)
virtual object Exec(DoubleType d, object arg)
virtual object Exec(IntersectionType i, object arg)
virtual object Exec(UserType u, object arg)
Represents a void type.
Definition: VoidType.cs:34
Represents a interface type.
virtual object Exec(ClassType c, object arg)
Represent a character type.
Definition: CharType.cs:38
virtual object Exec(TypeVariable t, object arg)
virtual object ReportError(TypeExpression typeExpression)
Abstract class that represents all different types.
Represents a generic type expression
Definition: TypeVariable.cs:36
Represents a proxy of a class type. It implements the unfold operatations of theoretical type systes...
virtual string FullName
Gets the full name of the type Note: WriteType expression is the longest recursive representation of ...
Represent a integer type.
Definition: IntType.cs:37
virtual object Exec(ClassTypeProxy c, object arg)
Represents a double type.
Definition: DoubleType.cs:36
virtual object ReportError(String operation, TypeExpression typeExpression)
Represent a null type.
Definition: NullType.cs:36
virtual object Exec(ArrayType a, object arg)
virtual object Exec(BCLClassType b, object arg)
virtual object ReportError(String operation, TypeExpression typeExpression, Location location)
virtual object Exec(StringType s, object arg)
virtual object Exec(FieldType g, object arg)
virtual object Exec(TypeExpression t, object arg)
virtual object Exec(BCLInterfaceType b, object arg)
Representa a property type.
Definition: PropertyType.cs:34
Representa a method type.
Definition: MethodType.cs:37
Represent a bool type.
Definition: BoolType.cs:36
virtual object Exec(NullType n, object arg)
Represents a class type.
Definition: ClassType.cs:35
virtual object Exec(InterfaceType i, object arg)
virtual object Exec(UnionType u, object arg)
Representa a field type.
Definition: FieldType.cs:37
virtual object Exec(BoolType b, object arg)
Representa an intersection type.
Represents a class or interface type.
Definition: UserType.cs:31
virtual object Exec(CharType c, object arg)