Example #1
0
        public static Boolean is_eiffel_string(object o)
        // Is `o' an instance of an Eiffel STRING.
        {
            RT_GENERIC_TYPE  l_gen_type;
            EIFFEL_TYPE_INFO info   = o as EIFFEL_TYPE_INFO;
            Boolean          Result = false;

            if (info != null)
            {
                l_gen_type = info.____type();
                if (l_gen_type == null)
                {
                    // Not a generic class, possibly a good candidate for STRING.
                    Result = info.____class_name().Equals("STRING");
                }
            }
            return(Result);
        }
Example #2
0
/*
 * feature -- Access
 */

        public static string generator(object Current)
        // Name of Current object's generating class
        // (base class of the type of which it is a direct instance)
        {
            string           Result    = null;
            EIFFEL_TYPE_INFO l_current = Current as EIFFEL_TYPE_INFO;

            if (Current == null)
            {
                generate_call_on_void_target_exception();
            }
            else if (l_current != null)
            {
                // This is a generated Eiffel type, we extract
                // stored type.
                Result = l_current.____class_name();
            }
            else
            {
                Result = Current.GetType().Name;
            }
            return(Result);
        }