Beispiel #1
0
        public bool doTest()
        {
            ReqDisplay.title("Requirement #10c");
            ReqDisplay.message("Testing semi extraction");

            result = FileUtils.fileLines(fileSpec2);
            if (!result)
            {
                return(false);
            }

            Lexer.Toker toker = new Lexer.Toker();
            toker.doReturnComments = true;
            toker.open(fileSpec2);
            Lexer.Semi semi = new Lexer.Semi();
            semi.toker = toker;

            while (!semi.isDone())
            {
                semi.get();
                replace(semi, "\n", "\\n");
                replace(semi, "\r", "\\r");
                //replace(semi, )
                semi.show();
            }
            return(result);
        }
        public bool doTest()
        {
            ReqDisplay.message("=============================================================");
            ReqDisplay.title("Requirement #2: Shall use the .Net System.IO and System.Text for all I/O");
            ReqDisplay.message("Showing using System.IO and System.Text in Semi.cs");
            StreamReader reader = new StreamReader(path);
            string       line;
            int          count = 0;

            while ((line = reader.ReadLine()) != null)
            {
                count++;
                if (count >= 40 && count <= 45)
                {
                    Console.WriteLine("        {0}", line);
                }
                if (count > 45)
                {
                    break;
                }
            }


            return(result);
        }
Beispiel #3
0
        public bool doTest()
        {
            ReqDisplay.title("Requirement #10b");
            ReqDisplay.message("Testing token extraction");

            result = FileUtils.fileLines(fileSpec1);
            if (!result)
            {
                return(false);
            }

            Lexer.Toker toker = new Lexer.Toker();
            toker.doReturnComments = true;
            toker.open(fileSpec1);
            List <Token> tokList = new List <Token>();

            while (!toker.isDone())
            {
                Token tok = toker.getTok();
                if (tok == "\n")
                {
                    tok = "\\n";
                }
                if (tok == "\r")
                {
                    tok = "\\r";
                }
                tokList.Add(tok);
            }
            ReqDisplay.showList(tokList, "Tokens:");
            return(result);
        }
 public bool doTest()
 {
     ReqDisplay.message("=============================================================");
     ReqDisplay.title("Requirement #6: The Client packages shall display requested results in a well formated GUI display");
     ReqDisplay.message("The result will be displayed on GUI client");
     return(result);
 }
        public bool doTest()
        {
            ReqDisplay.title("Requirement #6");
            ReqDisplay.message("Semi uses to get tokens until a terminator is retrieved");
            var toker = new Toker();

            fileSpec = Path.GetFullPath(fileSpec);
            if (!toker.open(fileSpec))
            {
                Console.Write("\n  toker can't open \"{0}\"", fileSpec);
                return(result = false);
            }

            Console.Write("\n  processing file \"{0}\"", fileSpec);
            var semi = new Semi();

            semi.toker = toker;
            while (!semi.isDone())
            {
                semi.get();
                semi.show();
            }

            return(result);
        }
Beispiel #6
0
        public bool doTest()
        {
            ReqDisplay.title("Requirement #9");
            ReqDisplay.message("Semi implements ITokenCollection");

            FileUtils.fileLines(fileSpec, 73, 75);
            return(result);
        }
Beispiel #7
0
        public bool doTest()
        {
            ReqDisplay.title("Requirement #8");
            ReqDisplay.message("Semi folds for loops");

            Console.Write("\n  demonstrated by the output of Req6 test");
            return(result);
        }
Beispiel #8
0
        public bool doTest()
        {
            ReqDisplay.title("Requirement #7");
            ReqDisplay.message("Semi terminators are \"{\", \"}\", \";\", \"\\n\" when first tok is \"#\"");

            Console.Write("\n  demonstrated by the output of Req6 test");
            return(result);
        }
 public bool doTest()
 {
     ReqDisplay.message("=============================================================");
     ReqDisplay.title("Requirement #7: Shall include an automated unit test suite");
     ReqDisplay.message("All above are automated unit test suites\n\n");
     ReqDisplay.message("Notice: If you click the Shut Down Server button,\n  please wait 10 seconds for server to close,\n  I have no clue why it takes this long");
     return(result);
 }
Beispiel #10
0
 public bool doTest()
 {
     ReqDisplay.title("Requirement #4");
     ReqDisplay.message("Toker implements state pattern");
     Finder.file = fileSpec;
     string[] toks = { "class", "{" };
     result = Finder.findSequence(true, toks);
     return(result);
 }
Beispiel #11
0
 public bool doTest()
 {
     ReqDisplay.title("Requirement #3");
     ReqDisplay.message("C# packages: Toker, SemiExp, ITokenCollection");
     FileUtilities.Navigate nav = new FileUtilities.Navigate();
     nav.Add("*.cs");
     nav.newDir  += new FileUtilities.Navigate.newDirHandler(onDir);
     nav.newFile += new FileUtilities.Navigate.newFileHandler(onFile);
     path         = "../../../Toker";
     nav.go(path, false);
     path = "../../../SemiExp";
     nav.go(path, false);
     return(result);
 }
        public bool doTest()
        {
            ReqDisplay.message("=============================================================");
            ReqDisplay.title("Requirement #4 & #5:The Server packages shall conduct Dependency and Strong Connected Component analysis");
            ReqDisplay.message("Send request for dependency analysis from auto client and display result on GUI client");
            ReqDisplay.message("-------------------------------------------------------------");
            AutoClient autoClient = new AutoClient(port);

            autoClient.sendDep();
            ReqDisplay.message("Send request for SCC analysis from auto client and display result on GUI client");
            ReqDisplay.message("-------------------------------------------------------------");
            autoClient.sendScc();
            autoClient.shutDown();

            return(result);
        }
        public bool doTest()
        {
            ReqDisplay.message("=============================================================");
            ReqDisplay.title("Requirement #1: Shall use Visual Studio 2017 and C# ");
            ReqDisplay.message("Show files in Parser directory");
            string[] files = System.IO.Directory.GetFiles(path);
            foreach (string fileName in files)
            {
                if (fileName.Substring(fileName.Length - 2, 2) == "cs")
                {
                    Console.WriteLine("        {0}", fileName);
                }
            }

            return(result);
        }
 public bool doTest()
 {
     ReqDisplay.message("=============================================================");
     ReqDisplay.title("Requirement #3: Shall provide C# packages as described in the Purpose section");
     ReqDisplay.message("Showing code files used inside packages");
     string[] files2 = System.IO.Directory.GetFiles(path + "SemiExp", "*.cs");
     foreach (string file in files2)
     {
         Console.WriteLine(file);
     }
     string[] files3 = System.IO.Directory.GetFiles(path + "TypeAnalysis", "*.cs");
     foreach (string file in files3)
     {
         Console.WriteLine(file);
     }
     string[] files4 = System.IO.Directory.GetFiles(path + "DependencyAnalysis", "*.cs");
     foreach (string file in files4)
     {
         Console.WriteLine(file);
     }
     string[] files5 = System.IO.Directory.GetFiles(path + "SCC", "*.cs");
     foreach (string file in files5)
     {
         Console.WriteLine(file);
     }
     string[] files8 = System.IO.Directory.GetFiles(path + "MessagePassingCommService", "*.cs");
     foreach (string file in files8)
     {
         Console.WriteLine(file);
     }
     string[] files9 = System.IO.Directory.GetFiles(path + "Gui", "*.cs");
     foreach (string file in files9)
     {
         Console.WriteLine(file);
     }
     string[] files10 = System.IO.Directory.GetFiles(path + "Server", "*.cs");
     foreach (string file in files10)
     {
         Console.WriteLine(file);
     }
     return(result);
 }
Beispiel #15
0
        public bool doTest()
        {
            ReqDisplay.title("Requirement #10a");
            ReqDisplay.message("Testing special tokens");

            Lexer.Toker      toker       = new Lexer.Toker();
            HashSet <string> oneCharToks = toker.oneCharTokens();

            ReqDisplay.showSet(oneCharToks, "one char Tokens:");
            Console.Write("\n  adding token \"@\"");
            toker.addOneCharToken("@");
            ReqDisplay.showSet(oneCharToks, "one char Tokens:");
            Console.Write("\n  removing token \"@\"");
            toker.removeOneCharToken("@");
            ReqDisplay.showSet(oneCharToks, "one char Tokens:");
            HashSet <string> twoCharToks = toker.twoCharTokens();

            ReqDisplay.showSet(twoCharToks, "two char Tokens:");
            return(result);
        }
        public bool doTest()
        {
            ReqDisplay.title("Requirement #5");
            ReqDisplay.message("Toker reads one token with each call to getTok()");
            var toker = new Toker();

            fileSpec = Path.GetFullPath(fileSpec);

            if (!toker.open(fileSpec))
            {
                Console.Write("\n  Toker can't open file \"{0}\"", fileSpec);
                return(result = false);
            }

            Console.Write("\n  tokenizing file \"{0}\"", fileSpec);
            for (var i = 0; i < 5; ++i)
            {
                Console.Write("\n  called Toker.getTok() to get \"{0}\"", toker.getTok());
            }
            return(result);
        }