一个用C#写的词法分析程序

2016-01-29 13:46 7 1 收藏

一个用C#写的词法分析程序,一个用C#写的词法分析程序

【 tulaoshi.com - ASP.NET 】

源文件内容:

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com)

namespace wzy2
{
 /// <summary
 /// Form1 的摘要说明。
 /// </summary
 public class Form1 : System.Windows.Forms.Form
 {
  private System.Windows.Forms.Label label1;

  private System.Windows.Forms.Button button1;
  private System.Windows.Forms.Button button2;
  private System.Windows.Forms.Button button3;

  private System.Windows.Forms.RichTextBox richTextBox1;
  private System.Windows.Forms.RichTextBox richTextBox2;

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com)

  private System.Windows.Forms.OpenFileDialog openFileDialog1;
  private System.Windows.Forms.SaveFileDialog saveFileDialog1;
 
  /// <summary
  /// 必需的设计器变量。
  /// </summary
  private System.ComponentModel.Container components = null;

  public Form1()
  {
   //
   // Windows 窗体设计器支持所必需的
   //
   InitializeComponent();

   //
   // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
   //
  }

  /// <summary
  /// 清理所有正在使用的资源。
  /// </summary
  protected override void Dispose( bool disposing )
  {
   if( disposing )
   {
    if (components != null)
    {
     components.Dispose();
    }
   }
   base.Dispose( disposing );
  }

  #region Windows 窗体设计器生成的代码
  /// <summary
  /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  /// 此方法的内容。
  /// </summary
  private void InitializeComponent()
  {
   this.label1 = new System.Windows.Forms.Label();
   this.button1 = new System.Windows.Forms.Button();
   this.richTextBox1 = new System.Windows.Forms.RichTextBox();
   this.button2 = new System.Windows.Forms.Button();
   this.richTextBox2 = new System.Windows.Forms.RichTextBox();
   this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
   this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
   this.button3 = new System.Windows.Forms.Button();
   this.SuspendLayout();
   //
   // label1
   //
   this.label1.Location = new System.Drawing.Point(8, 8);
   this.label1.Name = "label1";
   this.label1.Size = new System.Drawing.Size(72, 24);
   this.label1.TabIndex = 0;
   this.label1.Text = "词法分析";
   //
   // button1
   //
   this.button1.Location = new System.Drawing.Point(240, 8);
   this.button1.Name = "button1";
   this.button1.Size = new System.Drawing.Size(64, 23);
   this.button1.TabIndex = 1;
   this.button1.Text = "分析";
   this.button1.Click += new System.EventHandler(this.button1_Click);
   //
   // richTextBox1
   //
   this.richTextBox1.Location = new System.Drawing.Point(24, 48);
   this.richTextBox1.Name = "richTextBox1";
   this.richTextBox1.Size = new System.Drawing.Size(240, 352);
   this.richTextBox1.TabIndex = 2;
   this.richTextBox1.Text = "";
  // this.richTextBox1.TextChanged += new System.EventHandler(this.richTextBox1_TextChanged);
   //
   // button2
   //
   this.button2.Location = new System.Drawing.Point(96, 8);
   this.button2.Name = "button2";
   this.

来源:https://www.tulaoshi.com/n/20160129/1491433.html

延伸阅读
原理我像大家都很清楚,这里只说.NET(c#实现)。服务器每次启动或者重启,都是没登陆的。那意味着启动项里不只能做,我就考虑到使用Windows服务。Windows服务在系统加载时候就会启动所有服务,把程序写进里面应该没错了。 需要重启,那就要一个时间来效验,写法都有很多。我这里采用ini来存放。 Time 记录要重启的时间,验证时间。 Day 用来...
标签: PHP
在开始这篇文章时,作者假设读者已能够写出一个用户的登入认证程序. ---------------------------------------------------------- 记数器可完成访问 web 页的总次数,但却不能得知一个时段中访问量的动态记载,下面就来介绍如何写一个各个时段动态显示访问量的方法. 要记载访问量,首先就要在 mysql 内建立一个数据库,姑且给这...
在C#中有多种使用资源文件的方法,能够很方便地开发全球通用的应用程序。本文通过一个简单的小例子,来讲解在C#中如何利用资源文件,快速开发一个多种语言版本的程序。本例中只有一个窗体,三个控件,能够根据用户的设置以中文或英文界面运行。开发环境是Windows 2000 Professional、Microsoft Visual Studio.NET 2002。具体开发步骤如下:...
一段实例代码,程序的目的是使用 C#实现启动另一程序 的方法。技术总监給出了我们这样一个有效的启动程序的有效方法,現在和大家分享下: 以下是引用片段: private void btnCreate_Click(object sender, EventArgs e) ...{ int hWnd = FindWindow(null, "test");//窗體的...
这里我给大家提供一个很实用的例子,就是在线发送ICQ信息。想一想我们在网页上直接给朋友发送ICQ信息,那是多么美妙的事情啊。呵呵,在吹牛啊,其实ICQ本来就有在线发送的代码,不过,这些都是AOL给你写好的代码,多没有意思啊。还是自已写的比较好,呵呵,废话少说,大家来看代码吧 <br <br <% @ Page Language="C#" % <br <% @ ...

经验教程

881

收藏

32
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部