예제 #1
0
 internal static Creators Merge(BTValue val1, BTValue val2)
 {
     if (val1 == null || val2 == null)
     {
         return(new Creators());
     }
     else if (val1 is PrimitiveBTValue && val2 is PrimitiveBTValue)
     {
         return(PrimitiveBTValue.Merge(val1 as PrimitiveBTValue, val2 as PrimitiveBTValue));
     }
     else if (val1 is ReferenceBTValue && val2 is ReferenceBTValue)
     {
         return(ReferenceBTValue.Merge(val1 as ReferenceBTValue, val2 as ReferenceBTValue));
     }
     else if (val1 is PrimitiveBTValue)
     {
         return((val1 as PrimitiveBTValue).ToReferenceBTValueCreators());
     }
     else if (val2 is PrimitiveBTValue)
     {
         return((val2 as PrimitiveBTValue).ToReferenceBTValueCreators());
     }
     else
     {
         throw new InternalException();
     }
 }
예제 #2
0
            internal bool this [BTValue val1, BTValue val2]
            {
                get
                {
                    BTValuePair pair = new BTValuePair(val1, val2);
                    bool        flag = this.hash.Contains(pair);
                    this.hash[pair] = true;

                    return(flag);
                }
            }
예제 #3
0
        internal static Creators MergeMethods(AnnotatedMethod method1, AnnotatedMethod method2)
        {
            Creators crtrs = new Creators();

            for (int i = 0; i < method1.ParamVals.Count; i++)
            {
                crtrs.AddCreators(BTValue.Merge(method1.ParamVals[i].Val as ReferenceBTValue, method2.ParamVals[i].Val as ReferenceBTValue));
            }
            crtrs.AddCreators(BTValue.Merge(method1.ReturnValue, method2.ReturnValue));

            return(crtrs);
        }
예제 #4
0
        internal static bool EqualMethods(AnnotatedMethod method1, AnnotatedMethod method2)
        {
            if (!Equals(method1.ParamVals.Method, method2.ParamVals.Method))
            {
                return(false);
            }

            for (int i = 0; i < method1.ParamVals.Count; i++)
            {
                if (!BTValue.Equals(method1.ParamVals[i].Val as ReferenceBTValue, method2.ParamVals[i].Val as ReferenceBTValue))
                {
                    return(false);
                }
            }

            if (!BTValue.Equals(method1.ReturnValue, method2.ReturnValue))
            {
                return(false);
            }

            return(true);
        }
예제 #5
0
파일: BTValues.cs 프로젝트: DragonXYZ/cilpe
 internal BTValuePair(BTValue val1, BTValue val2)
 {
     this.val1 = val1;
     this.val2 = val2;
 }
예제 #6
0
파일: BTValues.cs 프로젝트: DragonXYZ/cilpe
            internal bool this[BTValue val1, BTValue val2]
            {
                get
                {
                    BTValuePair pair = new BTValuePair(val1, val2);
                    bool flag = this.hash.Contains(pair);
                    this.hash[pair] = true;

                    return flag;
                }
            }
예제 #7
0
파일: BTValues.cs 프로젝트: DragonXYZ/cilpe
 internal static Creators PseudoMerge(BTValue val1, BTValue val2)
 {
     if (val1 == null || val2 == null)
         return new Creators();
     else if (val1 is PrimitiveBTValue && val2 is PrimitiveBTValue)
         return PrimitiveBTValue.PseudoMerge(val1 as PrimitiveBTValue, val2 as PrimitiveBTValue);
     else if (val1 is ReferenceBTValue && val2 is ReferenceBTValue)
         return ReferenceBTValue.PseudoMerge(val1 as ReferenceBTValue, val2 as ReferenceBTValue);
     else if (val1 is PrimitiveBTValue)
         return (val1 as PrimitiveBTValue).ToReferenceBTValueCreators();
     else if (val2 is PrimitiveBTValue)
         return (val2 as PrimitiveBTValue).ToReferenceBTValueCreators();
     else
         throw new InternalException();
 }
예제 #8
0
파일: BTA.cs 프로젝트: DragonXYZ/cilpe
 public LiftException(BTValue val)
 {
     this.Creators = val.Lift();
 }
예제 #9
0
파일: BTA.cs 프로젝트: DragonXYZ/cilpe
 private void addCreator(BTValue val, ReferenceCreator crtr)
 {
     ObjectHashtable hash = new ObjectHashtable();
     AnnotatingVisitor.getAllBTValue(val, hash);
     foreach (BTValue v in hash.Keys)
         v.Creators[this].AddCreator(crtr);
 }
예제 #10
0
파일: BTA.cs 프로젝트: DragonXYZ/cilpe
 private static void getAllFieldBTValue(BTValue val, int depth, ObjectHashtable hash)
 {
     if (! hash.Contains(val) && depth > 0)
     {
         hash[val] = true;
         if (val is ReferenceBTValue)
             foreach (BTValue v in (val as ReferenceBTValue).GetAllFieldBTValues())
                 AnnotatingVisitor.getAllFieldBTValue(v, depth-1, hash);
     }
 }
예제 #11
0
 internal BTValuePair(BTValue val1, BTValue val2)
 {
     this.val1 = val1;
     this.val2 = val2;
 }