• 大小: 69KB
    文件类型: .rar
    金币: 2
    下载: 2 次
    发布日期: 2021-07-31
  • 语言: C/C++
  • 标签: 编译原理  C#  

资源简介

编译原理实验,C#实现, 运行正确,基本没有Bug...

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TokenAnalysis_FormApp
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnAnalysis_Click(object sender EventArgs e)
        {
            TokenAnalysis.TokenAnalysis ta = new TokenAnalysis.TokenAnalysis();
            ta.GetInput(rtxtInput.Text);
            ta.GetTokens();
            List< string > res = ta.GetResult();
            lstResult.Items.Clear();
            lstResult.Items.AddRange(res.ToArray());
        }

        private void btnExit_Click(object sender EventArgs e)
        {
            Application.Exit();
        }

        private void 保存SToolStripButton_Click(object sender EventArgs e)
        {
            saveFileDialog1.title = “保存分析结果“;
            saveFileDialog1.Filter = “文本文件|*.txt“;
            
            if( ( saveFileDialog1.ShowDialog() ) == DialogResult.OK ) {
                if( saveFileDialog1.FileName != null ) {

                    FileInfo outFile = new FileInfo( saveFileDialog1.FileName );
                    StreamWriter fw = outFile.AppendText();
                    foreach( string tkString in lstResult.Items ) {
                        fw.WriteLine( tkString );
                    }
                    fw.Close();

                }
            }
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      22528  2008-11-24 23:12  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\bin\Debug\TokenAnalysis_FormApp.exe

     文件      44544  2008-11-24 23:12  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\bin\Debug\TokenAnalysis_FormApp.pdb

     文件      14328  2008-11-24 23:12  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\bin\Debug\TokenAnalysis_FormApp.vshost.exe

     文件        490  2007-07-21 01:33  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\bin\Debug\TokenAnalysis_FormApp.vshost.exe.manifest

     文件       1620  2008-11-21 11:12  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\Form1.cs

     文件      13288  2008-11-21 11:12  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\Form1.Designer.cs

     文件      12433  2008-11-21 11:12  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\Form1.resx

     文件       2284  2008-11-24 23:12  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\obj\Debug\TokenAnalysis_FormApp.csproj.FileListAbsolute.txt

     文件        847  2008-11-21 11:12  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\obj\Debug\TokenAnalysis_FormApp.csproj.GenerateResource.Cache

     文件      22528  2008-11-24 23:12  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\obj\Debug\TokenAnalysis_FormApp.exe

     文件       4677  2008-11-21 11:12  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\obj\Debug\TokenAnalysis_FormApp.Form1.resources

     文件      44544  2008-11-24 23:12  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\obj\Debug\TokenAnalysis_FormApp.pdb

     文件        180  2008-11-18 10:42  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\obj\Debug\TokenAnalysis_FormApp.Properties.Resources.resources

     文件        502  2008-11-18 10:25  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\Program.cs

     文件       1384  2008-11-18 10:25  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\Properties\AssemblyInfo.cs

     文件       2892  2008-11-18 10:25  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\Properties\Resources.Designer.cs

     文件       5612  2008-11-18 10:25  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\Properties\Resources.resx

     文件       1106  2008-11-18 10:25  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\Properties\Settings.Designer.cs

     文件        249  2008-11-18 10:25  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\Properties\Settings.settings

     文件      10279  2008-11-24 23:12  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\TokenAnalysis.cs

     文件       3832  2008-11-18 10:42  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\TokenAnalysis_FormApp.csproj

     文件        953  2008-11-18 10:25  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp.sln

    ..A..H.     18944  2008-11-24 23:12  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp.suo

     目录          0  2008-11-18 10:32  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\obj\Debug\Refactor

     目录          0  2008-11-18 10:25  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\obj\Debug\TempPE

     目录          0  2008-11-18 12:00  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\bin\Debug

     目录          0  2008-11-24 23:12  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\obj\Debug

     目录          0  2008-11-18 12:00  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\bin

     目录          0  2008-11-18 12:00  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\obj

     目录          0  2008-11-18 12:00  Exp1\0_0_Project\TokenAnalysis_FormApp\TokenAnalysis_FormApp\Properties

............此处省略7个文件信息

评论

共有 条评论