Beispiel #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();
     }
 }
Beispiel #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);
                }
            }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #5
0
 internal BTValuePair(BTValue val1, BTValue val2)
 {
     this.val1 = val1;
     this.val2 = val2;
 }
Beispiel #6
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;
                }
            }
Beispiel #7
0
 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();
 }
Beispiel #8
0
 public LiftException(BTValue val)
 {
     this.Creators = val.Lift();
 }
Beispiel #9
0
 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);
 }
Beispiel #10
0
 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);
     }
 }
Beispiel #11
0
 internal BTValuePair(BTValue val1, BTValue val2)
 {
     this.val1 = val1;
     this.val2 = val2;
 }