public object Askfor(String typeName)
        {
            if (typeName == null)
            {
                UserInterface.ShowMsgAskForEnter("Pause..");
                return(null);
            }

            if (TypesHelper.GetNodeOrEdgeType(typeName, impl.curShellProcEnv.ProcEnv.NamedGraph.Model) != null) // if type is node/edge type let the user select the element in yComp
            {
                if (!CheckDebuggerAlive())
                {
                    impl.errOut.WriteLine("debug mode must be enabled (yComp available) for asking for a node/edge type");
                    return(null);
                }

                impl.debugOut.WriteLine("Select an element of type " + typeName + " by double clicking in yComp (ESC for abort)...");

                String id = debugger.ChooseGraphElement();
                if (id == null)
                {
                    return(null);
                }

                impl.debugOut.WriteLine("Received @(\"" + id + "\")");

                IGraphElement elem = impl.curShellProcEnv.ProcEnv.NamedGraph.GetGraphElement(id);
                if (elem == null)
                {
                    impl.errOut.WriteLine("Graph element does not exist (anymore?).");
                    return(null);
                }
                if (!TypesHelper.IsSameOrSubtype(elem.Type.PackagePrefixedName, typeName, impl.curShellProcEnv.ProcEnv.NamedGraph.Model))
                {
                    impl.errOut.WriteLine(elem.Type.PackagePrefixedName + " is not the same type as/a subtype of " + typeName + ".");
                    return(null);
                }
                return(elem);
            }
            else // else let the user type in the value
            {
                String       inputValue      = UserInterface.ShowMsgAskForString("Enter a value of type " + typeName + ": ");
                StringReader reader          = new StringReader(inputValue);
                GrShell      shellForParsing = new GrShell(reader);
                shellForParsing.SetImpl(impl.GetGrShellImpl());
                object val         = shellForParsing.Constant();
                String valTypeName = TypesHelper.XgrsTypeOfConstant(val, impl.curShellProcEnv.ProcEnv.NamedGraph.Model);
                if (!TypesHelper.IsSameOrSubtype(valTypeName, typeName, impl.curShellProcEnv.ProcEnv.NamedGraph.Model))
                {
                    impl.errOut.WriteLine(valTypeName + " is not the same type as/a subtype of " + typeName + ".");
                    return(null);
                }
                return(val);
            }
        }
        /// <summary>
        /// Returns the types to which the operands must be casted to,
        /// assuming an external type equality or ordering operator.
        /// Returns "" if the type can only be determined at runtime.
        /// Returns "-" in case of a type error and/or if no operator working on external types can be applied.
        /// </summary>
        private static string BalanceExternalType(string left, string right, IGraphModel model)
        {
            if (left == right)
            {
                return(left);
            }

            if (left == "" || right == "")
            {
                return("");
            }

            if (TypesHelper.IsSameOrSubtype(left, right, model) && TypesHelper.IsExternalTypeIncludingObjectType(right, model))
            {
                return(right);
            }

            if (TypesHelper.IsSameOrSubtype(right, left, model) && TypesHelper.IsExternalTypeIncludingObjectType(left, model))
            {
                return(left);
            }

            return("-");
        }