Exemple #1
0
        public static bool findSequence(bool findAll, params string[] toks)
        {
            bool found = false;

            if (!File.Exists(file))
            {
                return(false);
            }
            Lexer.Semi  semi  = new Lexer.Semi();
            Lexer.Toker toker = new Lexer.Toker();
            toker.open(file);
            semi.toker = toker;
            while (!semi.isDone())
            {
                semi.get();
                if (semi.hasSequence(toks))
                {
                    semi.show();
                    found = true;
                    if (findAll == false)
                    {
                        return(true);
                    }
                }
            }
            return(found);
        }
Exemple #2
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);
        }
Exemple #3
0
 public bool doTest()
 {
     ReqDisplay.title("Requirement #6");
     ReqDisplay.message("Semi uses to get tokens until a terminator is retrieved");
     Lexer.Toker toker = new Lexer.Toker();
     fileSpec = Path.GetFullPath(fileSpec);
     if (!toker.open(fileSpec))
     {
         Console.Write("\n  toker can't open \"{0}\"", fileSpec);
         return(result = false);
     }
     else
     {
         Console.Write("\n  processing file \"{0}\"", fileSpec);
     }
     Lexer.Semi semi = new Lexer.Semi();
     semi.toker = toker;
     while (!semi.isDone())
     {
         semi.get();
         semi.show();
     }
     return(result);
 }