示例#1
0
        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);
        }
示例#2
0
 public CollectionType(TypesTable.TypesTable tt, Classifier elemetnType, Classifier superClassifier)
     : this(tt, CollectionKind.Collection, elemetnType, superClassifier)
 {
 }
示例#3
0
        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);
        }
示例#4
0
 public SetType(TypesTable.TypesTable tt, Classifier elemetnType, Classifier superClassifier)
     : base(tt, CollectionKind.Set, elemetnType, superClassifier)
 {
 }
示例#5
0
 public Parameter([Localizable(false)] string name, Classifier type)
 {
     _Name = name;
     _Type = type;
 }
示例#6
0
 public bool ConformsToSimple(Classifier other)
 {
     return(TypeTable.ConformsTo(this, other, true));
 }
示例#7
0
 public override bool ConformsToRegister(Classifier other)
 {
     return(true);
 }
示例#8
0
 public override bool ConformsToRegister(Classifier other)
 {
     return(other == TypeTable.Library.Any);
 }
示例#9
0
 public virtual Classifier CommonSuperType(Classifier other)
 {
     return(TypeTable.CommonSuperType(this, other));
 }
示例#10
0
        /* 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));
        }
示例#11
0
 public DataType(TypesTable.TypesTable tt, Namespace ns, string name, Classifier superClassifier)
     : base(tt, ns, name, superClassifier)
 {
 }
示例#12
0
 internal PropertyCollection(Classifier owner)
 {
     this.owner = owner;
 }
示例#13
0
 internal OperationList(Classifier owner, string operationName)
 {
     this.owner       = owner;
     NameOfOperations = operationName;
 }
示例#14
0
 internal OperationCollection(Classifier owner)
 {
     this.owner = owner;
 }
示例#15
0
 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;
 }
示例#16
0
 private static string GetName(CollectionKind kind, Classifier elemetnType)
 {
     return(String.Format("{0}({1})", kind.ToString(), elemetnType.QualifiedName));
 }
示例#17
0
 public Classifier(TypesTable.TypesTable tt, Namespace ns, string name, Classifier superClassifier)
     : this(tt, ns, name)
 {
     this.SuperClassifier = superClassifier;
 }
示例#18
0
 public override bool ConformsTo(Classifier other)
 {
     return(ConformsToRegister(other));
 }
示例#19
0
 public override bool ConformsToRegister(Classifier other)
 {
     return(other.GetType() != typeof(InvalidType));
 }
示例#20
0
 public bool ConformsToComposite(Classifier other)
 {
     return(true);
 }
示例#21
0
 public override Classifier CommonSuperType(Classifier other)
 {
     return(other);
 }
示例#22
0
 public VariableDeclaration(string name, Classifier propertyType, OclExpression value)
 {
     this.Name         = name;
     this.PropertyType = propertyType;
     this.Value        = value;
 }
示例#23
0
 /// <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));
 }