大连理工大学编译技术总复习分解.ppt

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
* * * * * * * * * * * * * * * * * * * * * * 比较手工构造的NFA和用教材上语法制导的算法构造的NFA。鼓励学生写出引入尽可能少的? 转换的语法制导的算法,在将来的解题中使用这个算法。 * 《编译原理习题精选》1.5题。 * * * * * * * * * * * * * 在FRIST(T?)中,+, )和$在FOLLOW (T?) 中。 * * 在FRIST(T?)中,+, )和$在FOLLOW (T?) 中。 * * * * * * * * * * * * * * * 7.2 声 明 语 句 7.2.1 过程中的声明 计算被声明名字的类型和相对地址 P ? {offset := 0} D S D ? D ; D D ? id : T {enter ( id.name, T.type, offset); offset := offset + T.width } T ? integer {T.type := integer; T.width := 4 } T? real {T.type := real; T.width := 8 } T? array [ num ] of T1 {T.type := array (num.val, T1.type); T.width := num.val ? T1.width} T? ?T1 {T.type := pointer (T1.type); T.width := 4 } * 7.2 声 明 语 句 exchange readarray x a 表 头 空 sort quicksort 指向readarray partition v k 表 头 quicksort readarrary i 表 头 exchange 表 头 指向exchange partition program sort(input,output) var a:array[0..10] of integer; x:integer; prcedure readarray; procedure exchange(i,j:integer); procedure quicksort(m,n:integer) var k,v:integer; 22/32 * 7.2 声 明 语 句 7.2.2 作用域信息的保存 所讨论语言的文法 P ? D S D ? D ; D | id : T | proc id ; D ; S 语义动作用到的函数 mktable(previous) enter(table, name, type, offset) addwidth(table, width) enterproc(table, name, newtable) exchange readarray x a 表 头 空 sort quicksort readarrary i 表 头 mktable(↑sort) enter(table, name, type, offset) enterproc(↑sort,readarray,↑readarray) * 7.2 声 明 语 句 P ? M D S {addwidth (top (tblptr), top (offset) ); pop(tblptr); pop (offset) } M ? ? {t := mktable (nil); push(t, tblprt); push (0, offset) } D ? D1 ; D2 D ? proc id ; N D1; S {t := top(tblptr); addwidth(t, top(offset) ); pop(tblptr); pop(offset); enterproc(top(tblptr), id.name, t) } D?id : T {enter(top(tblptr), id.name, T.type, top(offset)); top(offset) := top(offset) + T.width } N ? ? {t := mktable(top(tblptr) ); push(t, tblptr); push(0, offset) } * 8.2 目 标 机 器 地址模式和它们的汇编语言形式及附加代价 地址模式 汇编语言形式 地址 附加代价 绝对地址 M M 1 寄存器 R R

文档评论(0)

1112111 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档