コード例 #1
0
ファイル: TupleType.cs プロジェクト: mff-uk/exolutio
        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
ファイル: Parameter.cs プロジェクト: mff-uk/exolutio
 public Parameter([Localizable(false)] string name, Classifier type)
 {
     _Name = name;
     _Type = type;
 }
コード例 #6
0
ファイル: TupleType.cs プロジェクト: mff-uk/exolutio
 public bool ConformsToSimple(Classifier other)
 {
     return(TypeTable.ConformsTo(this, other, true));
 }
コード例 #7
0
ファイル: InvalidType.cs プロジェクト: mff-uk/exolutio
 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
ファイル: DataType.cs プロジェクト: mff-uk/exolutio
 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
ファイル: InvalidType.cs プロジェクト: mff-uk/exolutio
 public override bool ConformsTo(Classifier other)
 {
     return(ConformsToRegister(other));
 }
コード例 #19
0
 public override bool ConformsToRegister(Classifier other)
 {
     return(other.GetType() != typeof(InvalidType));
 }
コード例 #20
0
ファイル: InvalidType.cs プロジェクト: mff-uk/exolutio
 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
ファイル: IteratorOperation.cs プロジェクト: mff-uk/exolutio
 /// <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));
 }