4 using System.Collections.Generic;
5 using DynVarManagement;
7 namespace TypeSystem.Operations {
9 internal class UnconstrainedDotOperation : DotOperation {
12 protected string memberName;
13 protected IList<TypeExpression> previousDot;
16 internal UnconstrainedDotOperation(
string memberName, IList<TypeExpression> previousDot) {
17 this.memberName = memberName;
18 this.previousDot = previousDot;
21 public override DotKind kindOfDot {
22 get {
return DotKind.Unconstrained; }
25 public override object Exec(
ArrayType d,
object arg) {
26 return d.AsClassType().AcceptOperation(
new UnconstrainedDotOperation(this.memberName, this.previousDot), arg);
30 #region BCLClass.member
32 public override object Exec(
BCLClassType d,
object arg) {
34 if (d.
Members.ContainsKey(
this.memberName))
35 return d.
Members[
this.memberName].Type;
44 return d.BaseClass.AcceptOperation(
new UnconstrainedDotOperation(this.memberName, this.previousDot), arg);
50 #region BCLInterfaceType.member
53 if (d.
Members.ContainsKey(memberName))
54 return d.
Members[memberName].Type;
58 if (memberType != null)
74 #region BoolType.member
76 public override object Exec(
BoolType d,
object arg) {
77 return d.AsClassType().AcceptOperation(
this, arg);
82 #region CharType.member
83 public override object Exec(
CharType d,
object arg) {
84 return d.AsClassType().AcceptOperation(
this, arg);
89 #region ClassType.member
90 public override object Exec(
ClassType d,
object arg) {
91 if (d.
Members.ContainsKey(
this.memberName))
92 return d.
Members[memberName].Type;
94 return d.BaseClass.AcceptOperation(
this, arg);
99 #region ClassTypeProxy.member
102 return d.RealType.AcceptOperation(
this, arg);
107 #region Double.member
108 public override object Exec(
DoubleType d,
object arg) {
109 return d.AsClassType().AcceptOperation(
this, arg);
113 #region FieldType.member
115 public override object Exec(
FieldType d,
object arg) {
117 return d.FieldTypeExpression.AcceptOperation(
new UnconstrainedDotOperation(this.memberName, this.previousDot), arg);
122 #region InterfaceType.member
125 if (d.
Members.ContainsKey(
this.memberName))
126 return d.
Members[
this.memberName].Type;
139 public override object Exec(
IntType d,
object arg) {
140 return d.AsClassType().AcceptOperation(
this, arg);
144 #region Property.member
146 public override object Exec(
PropertyType d,
object arg) {
148 return d.PropertyTypeExpression.AcceptOperation(
this, arg);
153 #region String.member
155 public override object Exec(
StringType d,
object arg) {
156 return d.AsClassType().AcceptOperation(
this, arg);
160 #region TypeExpression.member
166 #region TypeVariable.member
167 public override object Exec(
TypeVariable d,
object arg) {
169 DynVarOptions.Instance.AssignDynamism(d.Substitution, d.IsDynamic);
170 return d.Substitution.AcceptOperation(
this, arg);
176 #region UnionType.member
177 public override object Exec(
UnionType d,
object arg) {
179 if (this.previousDot.Contains(d))
189 returnType = UnionType.collect(returnType, ret);
195 #region Report Errors
198 System.Diagnostics.Debug.Assert(
false,
"No implementado");
static TypeVariable NewTypeVariable
Gets a new identify to the variable type
Representa an array type.
override object AcceptOperation(TypeSystemOperation op, object arg)
TypeExpression FindMember(string memberName)
Represents a interface type.
Represent a character type.
Abstract class that represents all different types.
Represents a generic type expression
Represents a proxy of a class type. It implements the unfold operatations of theoretical type systes...
Represent a integer type.
Represents a double type.
Dictionary< string, AccessModifier > Members
Gets and sets the attribute list
TypeExpression FieldTypeExpression
Gets the field type.
List< InterfaceType > InterfaceList
Gets the list of interfaces
virtual bool IsDynamic
Indicates if the type has been set as dynamic
Dictionary< string, AccessModifier > Members
Gets and sets the attribute list
Representa a property type.
ClassType BaseClass
Gets the base type (null if not exists).
IList< TypeExpression > TypeSet
Gets the list of type expressions
TypeExpression Substitution
Gets the substitution; null if it does not exist
TypeExpression PropertyTypeExpression
Gets the property type.
virtual object AcceptOperation(TypeSystemOperation op, object arg)
TypeExpression FindMember(string memberName)