1 using TypeSystem.Operations;
6 using System.Collections.Generic;
7 using TypeSystem.Constraints;
9 using DynVarManagement;
10 namespace TypeSystem.Operations {
22 this.operand2 = operand2;
26 #region Array.Equivalent(...)
30 if (arrayType != null)
36 if (bclClassType != null && bclClassType.TypeInfo.IsArray)
38 TypeExpression elementType = TypeTable.Instance.GetType(bclClassType.TypeInfo.GetElementType().FullName,
new Location());
47 #region BCLClassType.Equivalent(...)
49 if (this.operand2 == null)
52 if (operand1.
FullName.Equals(
this.operand2.FullName))
55 if ( (
bool)BCLClassType.BCLtoTypeSystemMapping.ContainsKey(operand1.FullName) && (
bool)BCLClassType.BCLtoTypeSystemMapping[operand1.FullName].AcceptOperation(
new EquivalentOperation(operand2), null))
59 Type elementType = operand1.TypeInfo.GetElementType();
62 return new BCLClassType(elementType.FullName, elementType).AcceptOperation(
new EquivalentOperation(( (ArrayType)this.operand2 ).ArrayTypeExpression), null);
65 if (bclType != null && bclType.TypeInfo.IsArray) {
66 TypeExpression thisArrayType = TypeTable.Instance.GetType(operand1.TypeInfo.GetElementType().FullName,
new Location()),
76 #region ClassTypeProxy(...)
79 return operand1.RealType.AcceptOperation(
this, arg);
83 #region FieldType (...)
87 if (fieldType != null)
89 return operand1.FieldTypeExpression.AcceptOperation(
this, arg);
93 #region MethodType.Equivalent(...)
96 if (operand1 == this.operand2)
100 if (typeVariable != null)
111 if ( !(
bool)operand1.MemberInfo.Class.AcceptOperation(
new EquivalentOperation(method.MemberInfo.Class), null) )
116 for (
int i = 0; i < operand1.ParameterListCount; i++)
117 if ( !(
bool)operand1.GetParameter(i).AcceptOperation(
new EquivalentOperation(method.GetParameter(i)), null) )
123 #region TypeExpression.Equivalent
125 if (this.operand2 == operand1)
128 if (typeVariable != null)
131 if (fieldType != null)
132 return fieldType.AcceptOperation(
this, arg);
134 if (unionType != null)
135 return this.operand2.FullName.Contains(operand1.FullName);
136 return operand1.FullName.Equals(this.operand2.FullName);
141 #region TypeVariable.Equivalent
144 DynVarOptions.Instance.AssignDynamism(operand1.Substitution, operand1.IsDynamic);
146 return operand1.EquivalenceClass.Substitution.AcceptOperation(
this, arg);
153 #region UnionType.Equivalent
164 System.Diagnostics.Debug.Assert(
false,
"Called Report Error in Equivalent operation. Revisite your code");
Representa an array type.
static TypeTable Instance
Gets the unique instance of TypeTable
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.
This class represent the entry wnen sending a message to an operation object derived from TypeExpress...
override object Exec(MethodType operand1, object arg)
override object Exec(TypeExpression operand1, object arg)
string MemberIdentifier
Gets the attribute name
override object Exec(BCLClassType operand1, object arg)
AccessModifier MemberInfo
Gets or sets the attribute information of method type
Abstract class that represents all different types.
Represents a generic type expression
TypeExpression GetType(string name, Location location)
Gets the type associated to the name specified in the argument.
Represents a proxy of a class type. It implements the unfold operatations of theoretical type systes...
EquivalentOperation(TypeExpression operand2)
virtual string FullName
Gets the full name of the type Note: WriteType expression is the longest recursive representation of ...
int ParameterListCount
Gets the number of parameters
No location information is provided within this class, because the exec methods invoked by the proper...
Type TypeInfo
Returns the real introspective type
Implementation of a table of types.
override object Exec(UnionType operand1, object arg)
TypeExpression FieldTypeExpression
Gets the field type.
TypeExpression ArrayTypeExpression
Gets the array type.
override object Exec(FieldType operand1, object arg)
override object ReportError(TypeExpression tE)
override object Exec(ClassTypeProxy operand1, object arg)
Representa a method type.
TypeExpression Substitution
Gets the substitution; null if it does not exist
override object Exec(TypeVariable operand1, object arg)
override object Exec(ArrayType operand1, object arg)
virtual object AcceptOperation(TypeSystemOperation op, object arg)