public void Requirement4_5(string[] args)
        {
            Console.Write("\n\t \tOutput of Requirement4\n");
            Console.Write("-----------------------------------------------------------------------------\n");
            Console.Write("This Project3 implements packages that evaluate all the dependencies between files in a specified file set");
            ShowCommandLine(args);
            List <string> files = ProcessCommandline(args);
            Executive     test  = new Executive();

            test.Execute_Parser(files);
            test.Execute_TypeAnalyzer();
            DepAnalysis.DepAnalysis dep = new DepAnalysis.DepAnalysis();
            StrongComp.filesGraphs = files;
            StrongComp.filenumber  = files.Count();
            StrongComp.setGraph();
            DepAnalysis.DepAnalysis.filesDepAnalysis = files;
            StrongComp.filesGraph = files;
            DepAnalysis.DepAnalysis.setDictionary();
            StrongComp.setGraphDictionary();
            Console.Write("\nDemonstrating Output Of Dependency Analysis");
            Console.Write("\n ==========================================");

            foreach (string file in files)
            {
                ITokenCollection semi = Factory.create();
                if (!semi.open(file as string))
                {
                    Console.Write("\n  Can't open {0}\n\n", files[0]);
                    return;
                }
                try {
                    while (semi.get().Count > 0)
                    {
                        dep.HoldUsingValue(semi);
                    }
                }
                catch (Exception ex) { Console.Write("\n\n  {0}\n", ex.Message); }
                semi.close();
                ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                if (!semi.open(file as string))
                {
                    Console.Write("\n  Can't open {0}\n\n", files[0]);
                    return;
                }
                try {
                    while (semi.get().Count > 0)
                    {
                        dep.analyze(semi, file);
                    }
                }
                catch (Exception ex) { Console.Write("\n\n  {0}\n", ex.Message); }
                StrongComp.addGraph();
                semi.close();
            }
            Console.Write("\n\n");
        }
//----< Test Stub >--------------------------------------------------
    static void Main(string[] args)
    {
        Console.Write("\n  Demonstrating StrongComponent");
        Console.Write("\n ====================================");
        ShowCommandLine(args);

        List <string> files = TestParser.ProcessCommandline(args);

        StrongComp.filesGraph  = files;
        StrongComp.filesGraphs = files;
        StrongComp.filenumber  = files.Count();
        StrongComp.setGraph();
        StrongComp.filesGraph = files;
        StrongComp.setGraphDictionary();

        foreach (string file in files)
        {
            StrongComp.addGraph();
        }
        Console.Write("\n\n");
    }
Beispiel #3
0
        public void Requirement4_5(string[] args)
        {
            Console.Write("\n\t \tOutput of Requirement4\n");
            Console.Write("-----------------------------------------------------------------------------\n");
            Console.Write("This Project3 implements packages that evaluate all the dependencies between files in a specified file set  \n");
            ShowCommandLine(args);

            List<string> files = ProcessCommandline(args);


            foreach (string file in files)
            {
                Console.Write("\n  Processing file {0}\n", System.IO.Path.GetFileName(file));

                ITokenCollection semi = Factory.create();
                if (!semi.open(file as string))
                {
                    Console.Write("\n  Can't open {0}\n\n", args[0]);
                    return;
                }
                BuildCodeAnalyzer builder = new BuildCodeAnalyzer(semi);
                Parser parser = builder.build();

                try
                {
                    while (semi.get().Count > 0)
                        parser.parse(semi);
                }
                catch (Exception ex)
                {
                    Console.Write("\n\n  {0}\n", ex.Message);
                }
                Console.Write("\n");

                semi.close();
            }


            DepAnalysis.DepAnalysis dep = new DepAnalysis.DepAnalysis();
            StrongComp.filesGraph = files;
            StrongComp.filesGraphs = files;
            StrongComp.filenumber = files.Count();
            StrongComp.setGraph();
            StrongComp.filesGraph = files;
            StrongComp.setGraphDictionary();
            DepAnalysis.DepAnalysis.filesDepAnalysis = files;
            DepAnalysis.DepAnalysis.setDictionary();


            foreach (string file in files)
            {
                Console.Write("\n  Processing file {0}\n", System.IO.Path.GetFileName(file));

                ITokenCollection semi = Factory.create();
                if (!semi.open(file as string))
                {
                    Console.Write("\n  Can't open {0}\n\n", args[0]);
                    return;
                }


                try
                {
                    while (semi.get().Count > 0)
                        dep.HoldUsingValue(semi);

                }

                catch (Exception ex)
                {
                    Console.Write("\n\n  {0}\n", ex.Message);
                }

                semi.close();
                ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                if (!semi.open(file as string))
                {
                    Console.Write("\n  Can't open {0}\n\n", args[0]);
                    return;
                }
                try
                {
                    while (semi.get().Count > 0)
                        dep.analyze(semi, file);
                }

                catch (Exception ex)
                {
                    Console.Write("\n\n  {0}\n", ex.Message);
                }

                semi.close();
                StrongComp.addGraph();


            }
            Console.Write("\n\n");
        }