当前位置: 首页 > news >正文

网站建站 宝网站开发后端开发

网站建站 宝,网站开发后端开发,网站转换小程序,网站安全检测产品优势《编译原理》学习第 5 天#xff0c;p25-p32总结#xff0c;总计 8 页。 一、技术总结 1.lexical lexical这个单词后续会经常用到#xff0c;所以首先要搞懂它的英文意思#xff0c;不然看到中文的“词法#xff0c;语法#xff0c;文法”这三个词的时候就会懵了——l…《编译原理》学习第 5 天p25-p32总结总计 8 页。 一、技术总结 1.lexical lexical这个单词后续会经常用到所以首先要搞懂它的英文意思不然看到中文的“词法语法文法”这三个词的时候就会懵了——lexical对应这三个里面的哪一个 1lexical: lexicon al加al后缀表明lexical是一个形容词(adjective)。 2lexicon: 词根是lexis(a word)。all the words used in a particular language。意思是“全部词汇”“词典”。 3lexical: adj. relating to words词汇(word)相关的。 所以lexical 对应着“词(word)法” lexical analyzer称为词法分析器。 2.production (1)定义 p26以C语言中的if-else 语句为例 if (expression) statement else statement 如果使用expr表expression使用stmt表示statement那么上述语句就可以表示成 stmt - if (expr) stmt else stmt -表示“can have the form”。形如“stmt - if (expr) stmt else stmt”这样的rule称为production。 (2)作用 书中没有给出明确的定义按照书中的定义长“stmt - if (expr) stmt else stmt”这样的就叫做production, 再简化一下还可写成 x - y“ x - y”这个production的含义是什么呢它的含义是x可以转为y。 (3)left side right side 以 “stmt - if (expr) stmt else stmt” 这个production为例- 左边的部分称为production的left side- 左边的部分称为production的right side。 3.token/terminal 在production中lexical element(如if, else)和 parenthsis称为token也称为terminal、terminal symbol。 p27, “we assume that digits, signs such as , and boldface strings such as while are terminals”。根据这句话terminal包含(1)digit如123。(2)signs: 如 。3boldface string: 如while。这里用boldface string很不好boldface是从印刷的角度来说的那非boldface的string是不是terminal呢 4.nonterminal stmt - if (expr) stmt else stmt 这个production p26, variables like expr and stmt represent sequences of tokens and are called nonterminals。在这里作者没有给出nonterminal的明确定义暂且根据这句话的意思把像expr和stmt这样的variable称为nonterminal然后继续往下阅读。 5.context-free grammar (1)定义 首先得对context-free grammar下定义什么是context-free grammarp26, In this section, we introduce a notation, called a context-free grammar(grammar, for short), for specifying the synaxt of a language。用于指定语言的语法的符号称为上下文无关文法简写为grammar。 context-free grammar由四部分构成 (1)a set of terminals。 (2)a set of nonterminals。 (3)a set of production。 (4)a start symbol。 “a designation of one of the nonterminals as the start symbol”——根据书中的定义start symbol是从nonterminals中指定的。 6.|符号(or) p27, For notational convenience, productions with the same nonterminals on the left can have their right sides grouped, with the algernative right sides separated by the symbol |, which we read as “or.”——为了方便表示可以把多个具有相同left side的production写成一个productionproduction的right side用符号| 隔开|读者“or”。 示例 以73-19-52, 为例我们把数字称为digit(即1是一个digit, 2是一个digit, 3是一个digtit…) 把用号或-号隔开的expression称为list( 3-1即是一个list9-52是一个list,1等数字是特殊的list)那么上面这三个expression使用production来表示可以写成 (1)digit - 0 | 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 (2)list - digit (3)list - list - digit (4)list - list digit 因为(2)、(3)、(4)这3个production的left side是一样的都是list, 那么可以写成一个production list - digit | list - digit | list digit 7.production for nonterminal p27, We say a production is for a nonterminal if the nonterminal appears on the left side of the production。 如果一个nonterminal出现在production的left side 那么我们就说这个production是这个nonterminal的production(这里有点拗口书上用的是for表示意思就是这个production是归属于这个nonterminal的)。 当看到“production for nonterminal”我们就要想到nonterminal是在production的left side。 8.parse tree (1)tree 关于tree相关的定义参考维基百科即可。书中提到的interior node实际就是我们常说的internal node。 (2)定义 grammar可以用tree来表示这样的tree称为parse tree。parse tree描绘了从start symbol生成string(如9-52)的过程。 二、其它 alphabet, string, language这三个概念书中没有严格的定义但却又是核心概念可以参考《Introduction to Automata Theory Languages and Computation》这本书。 今天的读书笔记写了很多也是因为书上很多概念没有明确的定义,需要把相关的内容全部记下然然后做交叉验证。 四、参考资料 1. 编程 (1)Alfred V. AhoMonica S. LamRavi SethiJeffrey D. Ullman《编译原理英文版·第1版》https://book.douban.com/subject/5416783/ 2. 英语 (1)Etymology Dictionaryhttps://www.etymonline.com (2) Cambridge Dictionaryhttps://dictionary.cambridge.org 欢迎搜索及关注编程人(a_codists)
http://www.zqtcl.cn/news/678048/

相关文章:

  • 速拓科技是做网站百度推广登陆入口官网
  • 十大高端网站设计网站开发培训达内
  • 河北云网站建设怎么让别人找你做网站
  • 怎么自己在电脑上做网站网络服务有哪些与对生活的影响
  • asp网站采集和平东路网站建设
  • 深圳市 交易建设中心网站越南的网站建设
  • 微网站建设方式构建网站系统
  • 优秀网站的要素有公司名字寓意好的字
  • 学习型网站空间网站模板免费下载酒店管理系统
  • icp备案网站用不了备案期间关闭网站
  • 上海电子门户网站建设数据公司签约网站
  • 北京品牌高端网站建设公司天津最好的网站建设公司
  • 网站开发中文摘要当今做啥网站致富
  • 钓鱼网站制作方法WordPress音乐免刷新
  • 北京网站建设的公网站订票策划方案
  • 做搜狗网站快速排名福田瑞沃自卸车
  • 帮人做图挣外快的网站做网站刷流量挣钱吗
  • 网站改版被降权从0到建网站
  • dedese网站牛客网官网
  • 网站到期续费要多少钱如何做一个电商
  • 试述网站建设的步骤石家庄公司网站如何制作
  • 百度推广自己做网站吗韶关东莞网站建设
  • 濮阳建站建设室内设计效果图图片
  • 上海找做网站公司国外网站国内做好还是国外做
  • 一个vps建两个网站怎么弄数据库济南地产行业网站开发
  • 网站到期请续费站长网
  • 个人网站名字可以用哪些促销网站怎么做
  • 网站开发需要提供哪些东西镇江网络违法网站
  • 都江堰建设局官方网站wordpress分享此文章
  • 素材网站整站下载赣州网站建设信息