示例#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
 internal BTValuePair(BTValue val1, BTValue val2)
 {
     this.val1 = val1;
     this.val2 = val2;
 }
示例#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;
                }
            }
示例#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();
 }
示例#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;
 }