Beispiel #1
0
        public void parse(Lexer.ITokenCollection semi, string currentFile)
        {
            DetectUsing dusing = new DetectUsing();

            if (dusing.test(semi))
            {
                namespacesUsed.Add(semi[1]);
            }
            if (semi.ToString().ToLower().Contains('='))
            {
                string classType = null;
                classType = (semi.ToString().Split('=')[0]).ToString().Split(' ')[0];
                if (TypeTable.TTable.table.ContainsKey(classType))
                {
                    List <TypeItem> function_list = new List <TypeItem>();
                    TypeTable.TTable.table.TryGetValue(classType, out function_list);
                    for (var i = 0; i < function_list.Count; i++)
                    {
                        if (namespacesUsed.Contains(function_list[i].namesp))
                        {
                            Console.WriteLine("    Dependency : " + function_list[i].file);
                            string fullPathParent = System.IO.Path.GetFileName(currentFile);
                            string fullPathChild = System.IO.Path.GetFileName(function_list[i].file);
                            int    parent, child;
                            FileNames.TryGetValue(fullPathChild, out child);
                            FileNames.TryGetValue(fullPathParent, out parent);
                            Graph.setDependency(parent, child);
                        }
                    }
                }
            }
        }
        //To create a Using Type list
        public void HoldUsingValue(Lexer.ITokenCollection semi)
        {
            Type retnvalue;

            DetectUsing du = new DetectUsing();

            retnvalue = du.testusing(semi);
            if (retnvalue != null)
            {
                UsingList.Add(retnvalue);
            }
        }