Example #1
0
 public static function_intersection_node get_function_intersection(function_node left, function_node right)
 {
     return left.get_intersecion(right);
 }
Example #2
0
 public static function_compare compare_functions(function_node left,function_node right)
 {
     function_intersection_node func_int_left = left.get_intersecion(right);
     function_intersection_node func_int_right = right.get_intersecion(left);
     if ((func_int_left == null) && (func_int_right == null))
     {
         return function_compare.non_comparable;
     }
     if ((func_int_left != null) && (func_int_right == null))
     {
         return func_int_left.function_relation;
     }
     if ((func_int_left == null) && (func_int_right != null))
     {
         if (func_int_right.function_relation == function_compare.non_comparable)
         {
             return function_compare.non_comparable;
         }
         if (func_int_right.function_relation == function_compare.greater)
         {
             return function_compare.less;
         }
         if (func_int_right.function_relation == function_compare.less)
         {
             return function_compare.greater;
         }
     }
     if ((func_int_left != null) && (func_int_right != null))
     {
         if ((func_int_left.function_relation == function_compare.less) &&
             (func_int_right.function_relation == function_compare.greater))
         {
             return function_compare.less;
         }
         if ((func_int_left.function_relation == function_compare.greater) &&
             (func_int_right.function_relation == function_compare.less))
         {
             return function_compare.greater;
         }
         throw new TreeConverter.CompilerInternalError("Contradiction in function relations");
     }
     throw new TreeConverter.CompilerInternalError("Error in function relations");
 }
Example #3
0
        public static void add_function_intersection(function_node left, function_node right,
            function_intersection_node intersec)
        {
#if DEBUG
            function_intersection_node func_int_left = left.get_intersecion(right);
            if (func_int_left != null)
            {
                throw new TreeConverter.CompilerInternalError("Duplicate function intersection");
            }
#endif
            left.add_intersection(right, intersec);
        }