/// <summary>
 /// Sets the hasType edge.
 /// </summary>
 /// <param name="node">[in] The new end point of the hasType edge.</param>
 /// <exception cref="Columbus.Lim.Asg.LimException">Throws LimException if there's something wrong with the given node.</exception>
 public void setHasType(Columbus.Lim.Asg.Nodes.Type.Type node)
 {
     if (m_hasType != 0)
     {
     }
     m_hasType = node.Id;
 }
示例#2
0
 /// <summary>
 /// Adds a new uses edge to the node and inserts it after the other ones.
 /// </summary>
 /// <param name="node">[in] The end point of the new uses edge.</param>
 /// <exception cref="Columbus.Lim.Asg.LimException">Throws LimException if there is something wrong with the given node.</exception>
 public void addUses(Columbus.Lim.Asg.Nodes.Type.Type node)
 {
     addUses(node.Id);
 }
示例#3
0
 /// <summary>
 /// Abstract end visitor, which calls the end visitor of the base class (Columbus.Lim.Asg.Nodes.Base.Base) of the Columbus.Lim.Asg.Nodes.Type.Type node.
 /// </summary>
 /// <param name="node">[in] The node which is visited.</param>
 public override void visitEnd(Columbus.Lim.Asg.Nodes.Type.Type node, bool callVirtualBase)
 {
     visitEnd((Columbus.Lim.Asg.Nodes.Base.Base)node, false);
 }
示例#4
0
        // ---------- Edge setter function(s) ----------

        /// <summary>
        /// Adds a new hasArguments edge to the node.
        /// </summary>
        /// <param name="node">[in] The end point of the new hasArguments edge.</param>
        /// <param name="acValue">[in] The value of the association class.</param>
        /// <exception cref="Columbus.Lim.Asg.LimException">Throws LimException if there is something wrong with the given node.</exception>
        public void addHasArguments(Columbus.Lim.Asg.Nodes.Type.Type node, Types.TypeArgumentConstraintKind acValue)
        {
            addHasArguments(node.Id, acValue);
        }
示例#5
0
 /// <summary>
 /// Deselects the actual node (and only this).
 /// </summary>
 /// <param name="node">[in] The node which is visited.</param>
 public override void visitEnd(Columbus.Lim.Asg.Nodes.Type.Type node, bool callVirtualBase)
 {
     selector(node.Id);
 }
示例#6
0
 /// <summary>
 /// Adds a new instantiates edge to the node and inserts it after the other ones.
 /// </summary>
 /// <param name="node">[in] The end point of the new instantiates edge.</param>
 /// <exception cref="Columbus.Lim.Asg.LimException">Throws LimException if there is something wrong with the given node.</exception>
 public void addInstantiates(Columbus.Lim.Asg.Nodes.Type.Type node)
 {
     addInstantiates(node.Id);
 }
示例#7
0
 /// <summary>
 /// Adds a new canThrow edge to the node and inserts it after the other ones.
 /// </summary>
 /// <param name="node">[in] The end point of the new canThrow edge.</param>
 /// <exception cref="Columbus.Lim.Asg.LimException">Throws LimException if there is something wrong with the given node.</exception>
 public void addCanThrow(Columbus.Lim.Asg.Nodes.Type.Type node)
 {
     addCanThrow(node.Id);
 }
示例#8
0
 /// <summary>
 /// Adds a new isSubclass edge to the node and inserts it after the other ones.
 /// </summary>
 /// <param name="node">[in] The end point of the new isSubclass edge.</param>
 /// <exception cref="Columbus.Lim.Asg.LimException">Throws LimException if there is something wrong with the given node.</exception>
 public void addIsSubclass(Columbus.Lim.Asg.Nodes.Type.Type node)
 {
     addIsSubclass(node.Id);
 }
示例#9
0
        /// <summary>
        /// Create MethodGenericInstance and connect to the Method, through the Instance edge.
        /// Furthermore, added GenericParameter to the MethodGenericInstance.
        /// </summary>
        /// <param name="symbol">Called method</param>
        /// <param name="refersTo">Called method definition</param>
        /// <returns>MethodGenericInstance node from the LIM</returns>
        public static MethodGenericInstance GetMGI(this ISymbol symbol, IMethodSymbol refersTo)
        {
            string uName = symbol.ToString();
            MethodGenericInstance mgi;

            if (MainDeclaration.Instance.MgiMap.TryGetValue(uName, out mgi))
            {
                return(mgi);
            }

            mgi = MainDeclaration.Instance.LimFactory.createMethodGenericInstanceNode();
            mgi.IsRealInstance = true;
            mgi.Name           = symbol.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat);
            mgi.MangledName    = uName;
            mgi.DemangledName  = uName;
            mgi.Language       = Types.LanguageKind.lnkCsharp;

            IMethodSymbol roslynNode = symbol as IMethodSymbol;

            Base owner = refersTo != null?refersTo.ConvertToLimNode() : symbol.OriginalDefinition.ConvertToLimNode();

            if (owner == null)
            {
                return(null);
            }
            if (Lim.Asg.Common.getIsMethod(owner))
            {
                Method ownerMethod = owner as Method;
                Commons.Common.Safe_Edge(ownerMethod, "Instance", mgi.Id);

                if (roslynNode.Arity > 0)
                {
                    int i = 0;
                    foreach (var argument in roslynNode.TypeArguments)
                    {
                        ITypeSymbol arg = null;
                        if (!argument.IsInMetadata() && argument.TypeKind != TypeKind.TypeParameter)
                        {
                            SyntaxNode _tmp = null;
                            arg = (INamedTypeSymbol)argument.GetDefinition(out _tmp);
                        }
                        Columbus.Lim.Asg.Nodes.Type.Type param = (arg != null) ? arg.GetLimType() : argument.GetLimType();
                        MainDeclaration.Instance.UsesStack.Peek().Remove(param.Id);

                        Types.TypeArgumentConstraintKind tack = Types.TypeArgumentConstraintKind.tackUpperBounded;
                        if (roslynNode.TypeParameters[i].ConstraintTypes.Any())
                        {
                            tack = Types.TypeArgumentConstraintKind.tackUnbounded;
                        }

                        bool found = false;
                        ListIteratorAssocTypeArgumentConstraintKind <Columbus.Lim.Asg.Nodes.Type.Type> cIt = mgi.HasArgumentsListIteratorAssocBegin;
                        while (cIt.getValue() != null)
                        {
                            Lim.Asg.Nodes.Type.Type value = cIt.getValue();
                            if (param.Id == value.Id)
                            {
                                found = true;
                                break;
                            }
                            cIt = cIt.getNext();
                        }
                        if (!found)
                        {
                            mgi.addHasArguments(param, tack);
                        }
                        i++;
                    }
                }
            }

            MainDeclaration.Instance.MgiMap.Add(uName, mgi);

            return(mgi);
        }
示例#10
0
 /// <summary>
 /// Adds a new hasType edge to the node and inserts it after the other ones.
 /// </summary>
 /// <param name="node">[in] The end point of the new hasType edge.</param>
 /// <exception cref="Columbus.Lim.Asg.LimException">Throws LimException if there is something wrong with the given node.</exception>
 public void addHasType(Columbus.Lim.Asg.Nodes.Type.Type node)
 {
     addHasType(node.Id);
 }
示例#11
0
        // ---------- Edge setter function(s) ----------

        /// <summary>
        /// Adds a new hasParameterConstraint edge to the node and inserts it after the other ones.
        /// </summary>
        /// <param name="node">[in] The end point of the new hasParameterConstraint edge.</param>
        /// <exception cref="Columbus.Lim.Asg.LimException">Throws LimException if there is something wrong with the given node.</exception>
        public void addHasParameterConstraint(Columbus.Lim.Asg.Nodes.Type.Type node)
        {
            addHasParameterConstraint(node.Id);
        }
示例#12
0
        // ---------- Edge setter function(s) ----------

        /// <summary>
        /// Adds a new hasParameterType edge to the node.
        /// </summary>
        /// <param name="node">[in] The end point of the new hasParameterType edge.</param>
        /// <param name="acValue">[in] The value of the association class.</param>
        /// <exception cref="Columbus.Lim.Asg.LimException">Throws LimException if there is something wrong with the given node.</exception>
        public void addHasParameterType(Columbus.Lim.Asg.Nodes.Type.Type node, Types.ParameterKind acValue)
        {
            addHasParameterType(node.Id, acValue);
        }