public bool ConformsToComposite(Classifier other) { TupleType otherType = other as TupleType; if (otherType == null) { return(false); } foreach (var otherVar in otherType) { Property thisVar; if (TupleParts.TryGetValue(otherVar.Name, out thisVar) == false) { return(false); } if (thisVar.Type.ConformsTo(otherVar.Type) == false) { return(false);// other neobsahuje propertu nebo neodpovida typ } } return(true); }
public CollectionType(TypesTable.TypesTable tt, Classifier elemetnType, Classifier superClassifier) : this(tt, CollectionKind.Collection, elemetnType, superClassifier) { }
public Classifier CommonSuperType <T>(Func <TypesTable.TypesTable, Classifier, T> creator, Classifier other) where T : CollectionType { if (other is T) { Classifier commonElementType = this.ElementType.CommonSuperType(((T)other).ElementType); if (commonElementType != null) { CollectionType commenType = creator(TypeTable, commonElementType); TypeTable.RegisterType(commenType); return(commenType); } } return(null); }
public SetType(TypesTable.TypesTable tt, Classifier elemetnType, Classifier superClassifier) : base(tt, CollectionKind.Set, elemetnType, superClassifier) { }
public Parameter([Localizable(false)] string name, Classifier type) { _Name = name; _Type = type; }
public bool ConformsToSimple(Classifier other) { return(TypeTable.ConformsTo(this, other, true)); }
public override bool ConformsToRegister(Classifier other) { return(true); }
public override bool ConformsToRegister(Classifier other) { return(other == TypeTable.Library.Any); }
public virtual Classifier CommonSuperType(Classifier other) { return(TypeTable.CommonSuperType(this, other)); }
/* public override int GetHashCode() { * return QualifiedName.GetHashCode(); * } * * public override bool Equals(object obj) { * if (obj is Classifier != true) { * return false; * } * return QualifiedName == ((Classifier)obj).QualifiedName; * }*/ public virtual bool ConformsTo(Classifier other) { return(TypeTable.ConformsTo(this, other)); }
public DataType(TypesTable.TypesTable tt, Namespace ns, string name, Classifier superClassifier) : base(tt, ns, name, superClassifier) { }
internal PropertyCollection(Classifier owner) { this.owner = owner; }
internal OperationList(Classifier owner, string operationName) { this.owner = owner; NameOfOperations = operationName; }
internal OperationCollection(Classifier owner) { this.owner = owner; }
protected CollectionType(TypesTable.TypesTable tt, CollectionKind collectionKind, Classifier elemetnType, Classifier superClassifier) : base(tt, new Namespace("isolatedNS"), GetName(collectionKind, elemetnType), superClassifier) { this.CollectionKind = collectionKind; this.ElementType = elemetnType; }
private static string GetName(CollectionKind kind, Classifier elemetnType) { return(String.Format("{0}({1})", kind.ToString(), elemetnType.QualifiedName)); }
public Classifier(TypesTable.TypesTable tt, Namespace ns, string name, Classifier superClassifier) : this(tt, ns, name) { this.SuperClassifier = superClassifier; }
public override bool ConformsTo(Classifier other) { return(ConformsToRegister(other)); }
public override bool ConformsToRegister(Classifier other) { return(other.GetType() != typeof(InvalidType)); }
public bool ConformsToComposite(Classifier other) { return(true); }
public override Classifier CommonSuperType(Classifier other) { return(other); }
public VariableDeclaration(string name, Classifier propertyType, OclExpression value) { this.Name = name; this.PropertyType = propertyType; this.Value = value; }
/// <summary> /// /// </summary> /// <param name="sourceType"></param> /// <param name="_bodyType"></param> /// <param name="tt"></param> /// <returns></returns> public Classifier BodyType(CollectionType sourceType, Classifier _bodyType, TypesTable.TypesTable tt) { return(bodyType(sourceType, _bodyType, tt)); }