예제 #1
0
        private static void testOneFile()
        {
            LexicAnalyst la = new LexicAnalyst("input.txt", "keywords.txt", "delimiters.txt");

            la.analyze();
            la.display();
            Console.ReadKey();
            Console.WriteLine();

            SyntaxAnalyst sa = new SyntaxAnalyst(la.getTables(), la.getLexemList());

            sa.start();
            sa.display();
            Console.ReadKey();
        }
예제 #2
0
        private static void testFiveFiles()
        {
            for (int i = 1; i <= 5; i++)
            {
                Console.WriteLine("\nTEST {0}:\n", i);

                string fileName = "input" + i + ".txt";
                displayFile(fileName);
                Console.WriteLine();

                LexicAnalyst la = new LexicAnalyst(fileName, "keywords.txt", "delimiters.txt");
                la.analyze();
                la.display();
                Console.WriteLine();

                SyntaxAnalyst sa = new SyntaxAnalyst(la.getTables(), la.getLexemList());
                sa.start();
                sa.display();
                Console.ReadKey();
            }
        }