Пример #1
0
        public static void Main(String[] args)
        {
            Console.WriteLine("################################################");
            Console.WriteLine("# Bve5_Parsing Syntax Testing.                 #");
            Console.WriteLine("################################################");

            bool end = false;

            while (!end)
            {
                switch (TEST_MODE)
                {
                case GrammarTestMode.DIALOGUE:
                    GrammarTypes type  = SelectGrammarTestType();
                    string       input = InteractiveTest();
                    Testing(input, type);
                    break;

                case GrammarTestMode.DIRECTLY:
                    Testing(INPUT_STRING, DIRECT_TYPE);
                    break;
                }

                //終了判定
                Console.WriteLine("End it? Y/N");
                string endInput = Console.ReadLine();
                if (endInput.Equals("Y") || endInput.Equals("y"))
                {
                    end = true;
                }
            }
        }
Пример #2
0
        /// <summary>
        /// 構文解析のテストメソッドを呼び出します。
        /// </summary>
        /// <param name="input">解析する文字列</param>
        /// <param name="type">構文解析器の種類</param>
        private static void Testing(string input, GrammarTypes type)
        {
            switch (type)
            {
            case GrammarTypes.MAP:
                MapGrammarTest(input);
                break;

            case GrammarTypes.SCENARIO:
                ScenarioGrammarTest(input);
                break;
            }
        }