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

网站建设需求文档下载山西住房和城乡建设部网站

网站建设需求文档下载,山西住房和城乡建设部网站,一般使用的分辨率的显示密度是多少dpi ),深圳龙岗网站开发系列文章戳这里#x1f447; 什么是上下文无关文法、最左推导和最右推导如何判断二义文法及消除文法二义性何时需要消除左递归什么是句柄、什么是自上而下、自下而上分析什么是LL(1)、LR(0)、LR(1)文法、LR分析表LR(0)、SLR(1)、LR(1)、LALR(1)文法之间的关系编译原理第三章习…系列文章戳这里 什么是上下文无关文法、最左推导和最右推导如何判断二义文法及消除文法二义性何时需要消除左递归什么是句柄、什么是自上而下、自下而上分析什么是LL(1)、LR(0)、LR(1)文法、LR分析表LR(0)、SLR(1)、LR(1)、LALR(1)文法之间的关系编译原理第三章习题词法分析、构建DFA、上下文无关文法、LL(1)分析、提取正规式证明LL(1)、SLR(1)、LALR(1)文法翻译方案、属性栈代码 编译原理—翻译方案、属性栈代码系列文章戳这里属性栈代码举个栗子引入标记非终结符模拟继承属性的计算文法如下S→(L)∣aL→L,S∣SS → (L) | a\\ L → L, S | S S→(L)∣aL→L,S∣S(a) 写一个翻译方案它输出每个 a 的嵌套深度。例如对于句子 (a, (a, a))输出的结果是 1 2 2。文法符号SL继承属性depth表示嵌套深度则翻译方案如下S′→{S.depth0}SS→({L.depthS.depth}L)S→a{print(S.depth)}L→{L1.depthL.depth,S.depthL.depth}L1,SL→{S.depthL.depth}S\begin{aligned} S→\{S.depth0\}S\\ S→(\{L.depth S.depth\}L)\\ S→a\{print(S.depth)\}\\ L→\{L_1.depthL.depth,S.depthL.depth\}L_1,S\\ L→\{S.depthL.depth\}S \end{aligned} S′SSLL​→{S.depth0}S→({L.depthS.depth}L)→a{print(S.depth)}→{L1​.depthL.depth,S.depthL.depth}L1​,S→{S.depthL.depth}S​属性栈代码由于 属性栈上仅能存放综合属性后文有详细介绍所以需要引入标记非终结符P、Q、R及其综合属性s继承属性i模拟继承属性的计算则栈代码如下S′→{S.depthP.s}PSP→ϵ{P.s0}Stack[ntop]0S→({Q.iS.depth,L.depthQ.s}QL)Q→ϵ{Q.sQ.i1}Stack[ntop]Stack[top−1]1S→a{print(S.depth)}print(Stack[top−1])L→{L1.depthL.depth,R.iL.depth,S.depthR.s}L1,RSR→ϵ{R.sR.i}Stack[ntop]Stack[top−2]L→{S.depthL.depth}S\begin{aligned} S→\{S.depthP.s\}PS\\ P→\epsilon\{P.s0\}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Stack[ntop]0\\ S→(\{Q.iS.depth,L.depth Q.s\}QL)\\ Q→\epsilon\{Q.sQ.i1\}\ \ \ \ \ \ \ \ \ \ \ \ Stack[ntop] Stack[top-1]1\\ S→a\{print(S.depth)\}\ \ \ \ \ \ \ \ \ \ print(Stack[top-1])\\ L→\{L_1.depthL.depth,R.iL.depth,S.depthR.s\}L_1,RS\\ R→\epsilon\{R.sR.i\}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Stack[ntop] Stack[top-2]\\ L→\{S.depthL.depth\}S \end{aligned} S′PSQSLRL​→{S.depthP.s}PS→ϵ{P.s0}                       Stack[ntop]0→({Q.iS.depth,L.depthQ.s}QL)→ϵ{Q.sQ.i1}            Stack[ntop]Stack[top−1]1→a{print(S.depth)}          print(Stack[top−1])→{L1​.depthL.depth,R.iL.depth,S.depthR.s}L1​,RS→ϵ{R.sR.i}                   Stack[ntop]Stack[top−2]→{S.depthL.depth}S​(b) 写一个翻译方案它打印出每个 a 在句子中是第几个字符。例如当句子是 (a, (a, (a, a),(a)))时打印的结果是 2 5 8 10 14。 使用综合属性out表示当前文法符号推出的字符总数基础属性before表示该文法符号前有多少个字符则翻译方案如下 S′→{S.before0}SS→{L.beforeS.before}(L){S.outL.out2}S→a{S.out1;print(S.before1)}L→{L1.beforeL.before,S.beforeL.beforeL1.out1}L1,S{L.outL1.outS.out1}L→{S.beforeL.before}S{L.outS.out}\begin{aligned} S→\{S.before0\}S\\ S→\{L.before S.before\} \\\ \ \ \ \ \ \ \ \ \ \ (L) \\\ \ \ \ \ \ \ \ \ \ \ \{S.outL.out2\}\\ S→a\{S.out1;print(S.before1)\}\\ L→\{L_1.beforeL.before, \\\ \ \ \ \ \ \ \ \ \ \ S.beforeL.beforeL_1.out1\} \\\ \ \ \ \ \ \ \ \ \ \ L_1,S \\\ \ \ \ \ \ \ \ \ \ \ \{L.outL_1.outS.out1\}\\ L→\{S.beforeL.before\}S\{L.outS.out\} \end{aligned} S′SSLL​→{S.before0}S→{L.beforeS.before}           (L)           {S.outL.out2}→a{S.out1;print(S.before1)}→{L1​.beforeL.before,           S.beforeL.beforeL1​.out1}           L1​,S           {L.outL1​.outS.out1}→{S.beforeL.before}S{L.outS.out}​ 同理上述翻译方案栈代码如下 S′→{S.beforeP.s}PSP→ϵ{P.s0}Stack[ntop]0S→({Q.iS.before,L.beforeQ.s}QL){S.outL.out2}Q→ϵ{Q.sQ.i1}Stack[ntop]Stack[top−1]1S→a{print(S.before)}print(Stack[top−1])L→{L1.beforeL.before,R.iL.beforeL1.out1,S.beforeR.s}L1,RS{L.outL1.outS.out1}Stack[ntop]Stack[top−3]Stack[top]1R→ϵ{R.sR.i}Stack[ntop]Stack[top−2]Stack[top−1]1L→{S.beforeL.before}S{L.outS.out}Stack[ntop]Stack[top]\begin{aligned} S→\{S.beforeP.s\}PS\\ P→\epsilon\{P.s0\}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Stack[ntop]0\\ S→(\{Q.i S.before,L.before Q.s\} \\\ \ \ \ \ \ \ \ \ \ \ QL) \\\ \ \ \ \ \ \ \ \ \ \ \{S.outL.out2\} \\ Q→\epsilon\{Q.sQ.i1\}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Stack[ntop] Stack[top-1]1\\ S→a\{print(S.before)\}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ print(Stack[top-1])\\ L→\{L_1.beforeL.before, \\\ \ \ \ \ \ \ \ \ \ \ R.iL.beforeL_1.out1, \\\ \ \ \ \ \ \ \ \ \ \ S.beforeR.s\} \\\ \ \ \ \ \ \ \ \ \ \ L_1,RS \\\ \ \ \ \ \ \ \ \ \ \ \{L.outL_1.outS.out1\} \ \ \ \ \ \ \ \ \ Stack[ntop]Stack[top-3]Stack[top]1 \\ R→\epsilon\{R.sR.i\}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Stack[ntop] Stack[top-2]Stack[top-1]1\\ L→\{S.beforeL.before\}S \\ \ \ \ \ \ \ \ \{L.outS.out\} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Stack[ntop]Stack[top] \end{aligned} S′PSQSLRL​→{S.beforeP.s}PS→ϵ{P.s0}                                              Stack[ntop]0→({Q.iS.before,L.beforeQ.s}           QL)           {S.outL.out2}→ϵ{Q.sQ.i1}                                   Stack[ntop]Stack[top−1]1→a{print(S.before)}                               print(Stack[top−1])→{L1​.beforeL.before,           R.iL.beforeL1​.out1,           S.beforeR.s}           L1​,RS           {L.outL1​.outS.out1}         Stack[ntop]Stack[top−3]Stack[top]1→ϵ{R.sR.i}                                          Stack[ntop]Stack[top−2]Stack[top−1]1→{S.beforeL.before}S       {L.outS.out}                                   Stack[ntop]Stack[top]​ 属性栈代码 如何在自底向上分析中计算继承属性 属性栈上仅能存放综合属性分析栈中符号的继承属性 属性copy规则 如果A→XYA→XYA→XY有语义规则Y.i:X.sY.i : X.sY.i:X.s 翻译方案可写为 A→X{Y.i:X.s}YA → X \{ Y.i : X.s \} YA→X{Y.i:X.s}Y 从句柄下面取继承属性! 举个栗子 有如下文法与翻译方案 D→T { L.in : T.type } L T→int { T.type : integer }T→real { T.type : real }L→ { L1.in : L.in }L1 , id {addtype(id.entry, L.in) }L→id { addtype(id.entry, L.in) }对于输入串int p,q,r 分析过程如下 引入标记非终结符模拟继承属性的计算
http://www.dnsts.com.cn/news/43990.html

相关文章:

  • 优秀个人网站模板下载公司网站建设案例教程
  • 淘宝客导购网站 丢单网站做定制还是固定模板
  • p2p网贷网站开发安徽地图
  • 做网站推广有作用没dedecms 营销网站模板
  • 网站建设汇编材料悬赏做海报的网站
  • 佛山行业网站设计公司深圳哪个区最好
  • 做网站 php python网站 微信认证
  • 泰安网站设计公司如何线上推广自己产品
  • 深圳网站建设者苏州建设交通职业技术学院官网
  • 设计师招聘网站有哪些南京电商设计
  • 新网站如何做网站优化百度教育官网
  • 快速建站平台淄博网站优化价格
  • 企业做英文网站网红营销的定义
  • vs2013可以做网站么电子商务专业网站建设
  • 静态网站开发语言优秀网站首页设计
  • 上海网站网站安全 代码
  • 宣传网站建设方案模板wordpress管理后台
  • 如何在百度做网站安平做网站的电话
  • 查询网站是否被收录做后期哪个网站素材好
  • 中国企业建设网站如何建设与维护网站
  • 在网站做推广要钱吗wordpress 页面伪静态页面
  • 大型网站建设公司 北京wordpress for sae 4.0
  • 360永久免费建网站wordpress中文手册
  • 动易的网站系统百度开户联系方式
  • 开发网站公司的简介网站上面的内容里面放照片怎么做
  • 怎样查找网站域名怎么免费建立网站
  • 百度网盘可以做网站吗毕业设计做app还是做网站
  • 投资建设项目管理师报名网站怎么降低wordpress版本
  • app开发人员网站wordpress 代码 加密
  • 建设网站尺寸多少学做网站论坛全部视频