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

资源简介

已知文法G[E]: E→E+T|T T→T*F|F F→(E)|i 说明:终结符号i为用户定义的简单变量, 即标识符的定义。 1、消除文法的左递归,构造对应文法的预测分析表; 2、实现LL(1)分析中控制程序(表驱动程序),并完成整个的LL(1)分析程序的界面设计、运行;

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Text;

namespace shiyan3
{
    class Chart
    {
        public string[] chart=new string[56];
        public Chart()
        {
            for(int i=0;i<5;i++)
                for(int j=0;j<6;j++)
                    chart[ij]=“error“;
            chart[0 0] = “Te“;
            chart[0 3] = “Te“;
            chart[1 1] = “+Te“;
            chart[1 4] = “ε“;
            chart[1 5] = “ε“;
            chart[2 0] = “Ft“;
            chart[2 3] = “Ft“;
            chart[31]=“ε“;
            chart[3 2] = “*Ft“;
            chart[3 4] = “ε“;
            chart[3 5] = “ε“;
            chart[4 0] = “i“;
            chart[4 3] = “(E)“;
            chart[0 4] = “synch“;
            chart[0 5] = “synch“;
            chart[2 1] = “synch“;
            chart[2 4] = “synch“;
            chart[2 5] = “synch“;
            chart[4 1] = “synch“;
            chart[4 2] = “synch“;
            chart[4 4] = “synch“;
            chart[4 5] = “synch“;
        }
        public string find(char a char b)
        {
            char[] zj=new char[6]{‘i‘‘+‘‘*‘‘(‘‘)‘‘$‘};
            char[] fzj = new char[5] { ‘E‘ ‘e‘ ‘T‘ ‘t‘ ‘F‘};
            for (int i = 0; i < 5; i++)
                for (int j = 0; j < 6; j++)
                {
                    if (fzj[i] ==a && zj[j] ==b)
                        return chart[i j];
                }
            return “error“;
        }
    }
}

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

     文件      24576  2012-05-24 09:10  shiyan3\shiyan3\bin\Debug\shiyan3.exe

     文件      34304  2012-05-24 09:10  shiyan3\shiyan3\bin\Debug\shiyan3.pdb

     文件       5632  2005-11-11 22:25  shiyan3\shiyan3\bin\Debug\shiyan3.vshost.exe

     文件       1532  2012-05-24 08:50  shiyan3\shiyan3\Chart.cs

     文件       2876  2012-05-24 09:10  shiyan3\shiyan3\Form1.cs

     文件       4188  2012-05-10 09:22  shiyan3\shiyan3\Form1.Designer.cs

     文件       5814  2012-05-10 09:22  shiyan3\shiyan3\Form1.resx

     文件        842  2012-05-10 09:22  shiyan3\shiyan3\obj\Debug\shiyan3.csproj.GenerateResource.Cache

     文件      24576  2012-05-24 09:10  shiyan3\shiyan3\obj\Debug\shiyan3.exe

     文件        180  2012-05-10 09:22  shiyan3\shiyan3\obj\Debug\shiyan3.Form1.resources

     文件      34304  2012-05-24 09:10  shiyan3\shiyan3\obj\Debug\shiyan3.pdb

     文件        180  2012-05-05 15:05  shiyan3\shiyan3\obj\Debug\shiyan3.Properties.Resources.resources

     文件        476  2012-05-31 08:08  shiyan3\shiyan3\obj\shiyan3.csproj.FileListAbsolute.txt

     文件        466  2012-05-05 20:06  shiyan3\shiyan3\Program.cs

     文件       1180  2012-05-05 15:05  shiyan3\shiyan3\Properties\AssemblyInfo.cs

     文件       2870  2012-05-05 15:05  shiyan3\shiyan3\Properties\Resources.Designer.cs

     文件       5612  2012-05-05 15:05  shiyan3\shiyan3\Properties\Resources.resx

     文件       1092  2012-05-05 15:05  shiyan3\shiyan3\Properties\Settings.Designer.cs

     文件        249  2012-05-05 15:05  shiyan3\shiyan3\Properties\Settings.settings

     文件       3293  2012-05-05 15:53  shiyan3\shiyan3\shiyan3.csproj

     文件       2627  2012-05-05 17:06  shiyan3\shiyan3\Stack.cs

     文件        910  2012-05-05 15:05  shiyan3\shiyan3.sln

    ..A..H.     13312  2012-05-31 08:13  shiyan3\shiyan3.suo

     目录          0  2012-05-05 15:11  shiyan3\shiyan3\obj\Debug\Refactor

     目录          0  2012-05-05 15:05  shiyan3\shiyan3\obj\Debug\TempPE

     目录          0  2012-05-05 15:05  shiyan3\shiyan3\bin\Debug

     目录          0  2012-05-24 09:10  shiyan3\shiyan3\obj\Debug

     目录          0  2012-05-05 15:05  shiyan3\shiyan3\bin

     目录          0  2012-05-05 15:05  shiyan3\shiyan3\obj

     目录          0  2012-05-05 15:05  shiyan3\shiyan3\Properties

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

评论

共有 条评论