示例#1
0
        void CheckParsing(string s)
        {
            ProgramParse ps = new ProgramParse();

            ps.Parse(s);
            string       str1 = ps.statements.ToString();
            ProgramParse ps2  = new ProgramParse();

            ps2.Parse(str1);
            string       str2 = ps2.statements.ToString();
            ProgramParse ps3  = new ProgramParse();

            ps3.Parse(str2);
            string str3 = ps2.statements.ToString();

            if (str2 != str3)
            {
                Console.WriteLine(str2);
                Console.WriteLine(str3);
                throw new Exception();
            }
            ps3.Run();
            Console.WriteLine();
            //Console.WriteLine(ps.output);
        }
示例#2
0
        private void button2_Click(object sender, EventArgs e)
        {
            ProgramParse ps = new ProgramParse();

            ps.Parse(textBox2.Text);
            ps.Run();
            textBox3.Text = ps.output;
        }
示例#3
0
        void T(string s)
        {
            ProgramParse ps = new ProgramParse();

            ps.Parse(s);
            string str1 = ps.statements.ToString();

            ps.Run();
            //Console.WriteLine(str1);
            Console.WriteLine(ps.output);
        }