Пример #1
0
        private void GetTable_Click(object sender, EventArgs e)
        {
            LALR1Table t = new LALR1Table();

            t.LogName(inputLogName);
            t.InputGotoAndActionTable(backEnd.GetGotoTable(), backEnd.GetActionTable());
            t.BuildTable();
            t.InputLog(backEnd.FetchOutput());

            t.Show();
            if (isSyntaxValid)
            {
                AnalyzeInput.Enabled = true;
            }
            else
            {
                MessageBox.Show("不是LALR1文法,无法使用Analyze按钮");
            }
        }
Пример #2
0
        private void FromKeyBorad_Click(object sender, EventArgs e)
        {
            string line = inputTextBox.Text;

            //Console.WriteLine("line :" + line);
            alogrithm.Analyze(line);
            MessageBox.Show("运行完成");
            stackOutput.Clear();
            InputOutput.Clear();
            LogOutput.Clear();
            log                  = alogrithm.FetchOutput();
            outputLine           = 0;
            FinishButton.Enabled = true;
            NextStep.Enabled     = true;
        }