Esempio n. 1
0
File: NFA.cs Progetto: zzhi/Algs4Net
        public static void MainTest(string[] args)
        {
            string regexp = "(" + args[0] + ")";
            string txt    = args[1];
            NFA    nfa    = new NFA(regexp);

            Console.WriteLine(nfa.Recognizes(txt));
        }
Esempio n. 2
0
        public static void MainTest(string[] args)
        {
            TextInput StdIn  = new TextInput();
            string    regexp = "(.*" + args[0] + ".*)";
            NFA       nfa    = new NFA(regexp);

            while (StdIn.HasNextLine())
            {
                string line = StdIn.ReadLine();
                if (nfa.Recognizes(line))
                {
                    Console.WriteLine(line);
                }
            }
        }