登录
首页 » c++ » LL(1)文法

LL(1)文法

于 2022-03-15 发布 文件大小:931.31 kB
0 132
下载积分: 2 下载次数: 1

代码说明:

FIRST(α)的构造实现代码 FIRST(α)的构造算法 要构造FIRST(α),根据定义: α=X1?Xn 那么对于从前到后的Xi我们进行分类讨论: 如果Xi∈Vt,那么FIRST(α)=FIRST(Xi)={Xi} 如果Xi∈Vn,因为不存在左递归,所以Xi=a.......|?,那么FIRST(Xi)={a,?,FIRST(Xi+1)} 只要Xi?1不包含?,那么Xi不可能影响FIRST(α) 那么我们通过记录每个a∈V,然后进行深度优先记忆化搜索,将所有的状态填满,因为LL(1)文法使不会回溯的,所以能够保证在O(n)的时间完成,采取递归的形式实现

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • juyuwang
    该程序简单介绍了如何创建局域网的C/S工作模式,简单可靠。(The simple procedure describes how to create LAN C/S mode, simple and reliable.)
    2011-10-14 14:31:59下载
    积分:1
  • 三维多智能体仿真再现3d-多智能体
    展现了三维多智能体仿真再现,实现了多智能体协同一致性。(The simulation representation of 3d multi-agent is presented and the multi-agent couniformity is realized.)
    2020-11-16 15:39:40下载
    积分:1
  • chemical-elements
    描述了化学元素对钢的性能的影响,值得一看,这是别人的资料(Description of the chemical elements in the performance of steel)
    2012-10-15 13:46:07下载
    积分:1
  • 二叉排序树的基本操作
    该源代码详细介绍了有关二叉树的所有相关操作(The source code details all related operations on the two fork tree.)
    2018-05-22 12:00:30下载
    积分:1
  • C# 读取Access中的数据到datagridview,并修改DataGridView中的数据并保存到access数据库
    可通过此实例在软件中直接改变数据库中的数据
    2020-04-02下载
    积分:1
  • OPCCSharp
    c# OPC通讯包装类,已在项目中应用,可参考(c# OPC communication wrapper class has been in the project application, can be found)
    2010-03-12 11:36:11下载
    积分:1
  • C#飞行棋游戏
    本代码使用C#语言在vs2010环境下开发的一个飞行棋的游戏。游戏是两人对战的,通过投掷骰子的多少前进一定的步数,谁先走到标记为100的地方就获胜。在游戏过程中会遇到4中障碍,如地雷、时空隧道、暂停等。还有一点是如果两个人走到同一个地方,前一个人会被踩到出发点。
    2022-02-25 19:37:28下载
    积分:1
  • SerializeTest
     C#对象序列化实现测试代码。代码实现将生成的对象中属性序列化为XML格式,用于将对象数据保存。(C# object serialization to achieve the test code)
    2023-09-07 16:00:03下载
    积分:1
  • manualCSharp
    pseudocodigo for cSharpDevelop
    2012-07-02 07:31:15下载
    积分:1
  • C# 实现 MD5加密解密算法
    using System.Security.Cryptography;using    System.IO;  using    System.Text; ///MD5加密  public string MD5Encrypt(string    pToEncrypt,  string    sKey)    {       DESCryptoServiceProvider    des  =  new    DESCryptoServiceProvider();     byte[]    inputByteArray  =    Encoding.Default.GetBytes(pToEncrypt);       des.Key  =    ASCIIEncoding.ASCII.GetBytes(sKey);       des.IV  =    ASCIIEncoding.ASCII.GetBytes(sKey);       MemoryStream    ms  =  new    MemoryStream();       CryptoStream    cs  =  new    CryptoStream(ms,    des.CreateEncryptor(),CryptoStreamMode.Write);       cs.Write(inputByteArray,  0,    inputByteArray.Length);       cs.FlushFinalBlock();       StringBuilder    ret  =  new    StringBuilder();     foreach(byte    b  in    ms.ToArray())       {        ret.AppendFormat("{0:X2}",    b);       }       ret.ToString();     return    ret.ToString();      }  ///MD5解密  public string MD5Decrypt(string    pToDecrypt,  string    sKey)    {      DESCryptoServiceProvider    des  =  new    DESCryptoServiceProvider();     byte[]    inputByteArray  =  new  byte[pToDecrypt.Length  /  2];     for(int    x  =  0;    x  <    pToDecrypt.Length  /  2;    x )       {      int    i  =    (Convert.ToInt32(pToDecrypt.Substring(x  *  2,  2),  16));        inputByteArray[x]  =    (byte)i;       }       des.Key  =    ASCIIEncoding.ASCII.GetBytes(sKey);       des.IV  =    ASCIIEncoding.ASCII.GetBytes(sKey);       MemoryStream    ms  =  new    MemoryStream();       CryptoStream    cs  =  new    CryptoStream(ms,    des.CreateDecryptor(),CryptoStreamMode.Write);       cs.Write(inputByteArray,  0,    inputByteArray.Length);       cs.FlushFinalBlock();       StringBuilder    ret  =  new    StringBuilder();                  return    System.Text.Encoding.Default.GetString(ms.ToArray());      }
    2013-11-13下载
    积分:1
  • 696516资源总数
  • 106658会员总数
  • 16今日下载