コード例 #1
0
        /// <summary>
        /// Main method (Entry point)
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            Console.Write("\n\t\t\t  Demonstrating Parser");
            Console.Write("\n\t =========================================================\n");
            ReqOneTwo();
            ReqThree();
            Console.WriteLine("Following files are being evaluated:\t");
            Dictionary <string, List <Elem> > dicTables = new Dictionary <string, List <Elem> >();
            ResultSet oResult = new ResultSet();

            Console.Write("\n\n\t\t  Displaying Type Tables ");
            Console.Write("\n\t\t ==========================\n");
            TAnal objTAnalysis = new TAnal();

            dicTables = objTAnalysis.DoTypeAnalysis(GetFilesFromArg(args[0]));
            oResult.WriteTypeAnalysisResult(dicTables);
            Display.ShowTypeTables(dicTables);
            Console.Write("\n\t\t  Displaying Dependencies ");
            Console.Write("\n\t\t =========================\n");
            Dependencies objDependencies = new Dependencies();
            Dictionary <string, HashSet <string> > dicDependencies = new Dictionary <string, HashSet <string> >();

            dicDependencies = objDependencies.DoAnalysis(dicTables);
            oResult.WriteDepAnalysisResult(dicDependencies);
            Display.ShowDependencies(dicDependencies);
            Console.Write("\n\t\t  Displaying Strong Components ");
            Console.Write("\n\t\t ===============================\n");
            Scc objScc = new Scc();
            HashSet <List <string> > lstScc = objScc.GetSCC(dicDependencies);

            oResult.WriteSCCResult(lstScc);
            Display.ShowSCC(lstScc);
            Console.Write("\n\n");
            //Console.ReadLine();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            Console.Write("\n  Testing Type Analysis package");
            Console.Write("\n ===========================\n");
            TAnal objAnalysis = new TAnal();
            Dictionary <string, List <Elem> > dicResult = new Dictionary <string, List <Elem> >();
            List <string> lstFiles = new List <string> {
                System.IO.Path.GetFullPath("../../Parser.cs"), System.IO.Path.GetFullPath("../../TAnal.cs")
            };

            dicResult = objAnalysis.DoTypeAnalysis(lstFiles);
            Console.Write("\n  Printing type tables\n");
            foreach (KeyValuePair <string, List <Elem> > table in dicResult)
            {
                Console.Write("\n\n");
                Display.showMetricsTable(table.Key, table.Value);
            }
            Console.ReadLine();
        }