17 using System.Collections.Generic;
19 using System.Text.RegularExpressions;
22 using ErrorManagement;
24 using TypeSystem.Operations;
26 namespace TypeSystem {
45 private bool setAccess;
50 private bool getAccess;
65 get {
return this.propertyType; }
72 get {
return this.memberInfo; }
74 if (this.memberInfo == null) {
75 this.memberInfo = value;
93 this.propertyType = type;
94 this.getAccess = canRead;
95 this.setAccess = canWrite;
101 #region BuildTypeExpressionString
107 if (this.ValidTypeExpression)
return this.typeExpression;
108 if (depthLevel <= 0)
return this.FullName;
111 if (this.propertyType == null)
113 this.fullName = this.propertyType.FullName;
117 tE.AppendFormat(
"Property({0}, {1},", this.MemberInfo.Class.BuildTypeExpressionString(depthLevel-1), this.
MemberInfo.
MemberIdentifier);
120 for (
int i = 0; i < this.MemberInfo.Modifiers.Count - 1; i++) {
121 tE.AppendFormat(
" {0} x", this.MemberInfo.Modifiers[i]);
123 tE.AppendFormat(
" {0}", this.MemberInfo.Modifiers[this.MemberInfo.Modifiers.Count - 1]);
128 tE.Append(this.propertyType.BuildTypeExpressionString(depthLevel-1));
130 this.ValidTypeExpression =
true;
131 return this.typeExpression=tE.ToString();
135 #region BuildFullName()
141 this.fullName = String.Format(
"{0}.{1}:{2}", this.MemberInfo.Class.FullName,
142 this.MemberInfo.MemberIdentifier, this.propertyType.FullName);
144 this.fullName = this.propertyType.FullName;
154 #region Dot() ANULADA
188 #region Bracket() ANULADA
208 #region Assignment() ANULADA
236 #region Arithmetic() ANULADA
272 #region Relational() ANULADA
296 #region PromotionLevel() ANULADA
323 this.ValidTypeExpression =
false;
324 te.ValidTypeExpression =
false;
330 #region HasTypeVariables()
338 return this.hasTypeVariablesCache;
339 bool toReturn = this.propertyType.HasTypeVariables();
340 this.validHasTypeVariables =
true;
341 return this.hasTypeVariablesCache = toReturn;
349 internal override TypeExpression Clone(IDictionary<int, TypeVariable> clonedTypeVariables, IList<EquivalenceClass> equivalenceClasses, MethodType methodAnalyzed) {
363 if (newPropertyType.propertyType != null)
364 newPropertyType.propertyType = newPropertyType.propertyType.Clone(clonedTypeVariables,equivalenceClasses, methodAnalyzed);
365 return newPropertyType;
379 return this.propertyType.ILType();
384 #region IsValueType()
392 return this.propertyType.IsValueType();
Represents a error produced when a MethodType has class information and tries to assign other class i...
bool validHasTypeVariables
To cache the result of the HasTypeVariables method
This class represent the entry wnen sending a message to an operation object derived from TypeExpress...
override bool IsValueType()
True if type expression is a ValueType. Otherwise, false.
override string BuildTypeExpressionString(int depthLevel)
Creates the type expression string.
string MemberIdentifier
Gets the attribute name
Abstract class that represents all different types.
override void BuildFullName()
Creates/Updates the full name of the type expression
System.Text.StringBuilder StringBuilder
override string ILType()
Gets the string type to use in IL code.
override object AcceptOperation(TypeSystemOperation op, object arg)
Representa a property type.
List< Modifier > Modifiers
Gets the modifiers of the element
Association Class between ClassType and MethodType (or Fields). Represents the access modifier inform...
AccessModifier MemberInfo
Gets or sets the attribute information of method type
TypeExpression PropertyTypeExpression
Gets the property type.
PropertyType(TypeExpression type, bool canRead, bool canWrite)
Constructor of PropertyType
override bool Unify(TypeExpression te, SortOfUnification unification, IList< Pair< TypeExpression, TypeExpression >> previouslyUnified)
Check if the type can make an array operation.
override bool HasTypeVariables()
To know if the type expression has some type variables and requieres unification The default implemen...
Representa a class attribute (fields or methods).