编译原理-声明语句的翻译
- 格式:ppt
- 大小:1.12 MB
- 文档页数:42
DataStruc tures基本数据结构 Dic tiona ries字典Prior ity Q ueues堆Graph Data Stru cture s 图SetDataStruc tures集合Kd-T rees线段树Nume rical Prob lems数值问题Sol vingLinea r Equ ation s 线性方程组Bandw idthReduc tion带宽压缩Mat rix M ultip licat ion 矩阵乘法Dete rmina nts a nd Pe rmane nts 行列式Const raine d and Unco nstra inedOptim izati on 最值问题Linea r Pro gramm ing 线性规划Rand om Nu mberGener ation随机数生成F actor ing a nd Pr imali ty Te sting因子分解/质数判定Ar bitra ry Pr ecisi on Ar ithme tic 高精度计算Kna psack Prob lem 背包问题Disc reteFouri er Tr ansfo rm 离散Fouri er变换Com binat orial Prob lems组合问题Sor ting排序Searc hing查找Media n and Sele ction中位数Gen erati ng Pe rmuta tions排列生成Ge nerat ing S ubset s 子集生成G enera tingParti tions划分生成Ge nerat ing G raphs图的生成Ca lendr icalCalcu latio ns 日期Jo b Sch eduli ng 工程安排Satis fiabi lity可满足性Gra ph Pr oblem s ——polyn omial图论-多项式算法Con necte d Com ponen ts 连通分支Topol ogica l Sor ting拓扑排序Min imumSpann ing T ree 最小生成树Sho rtest Path最短路径Tr ansit ive C losur e and Redu ction传递闭包Ma tchin g 匹配Eul erian Cycl e / C hines e Pos tmanEuler回路/中国邮路Edgeand V ertex Conn ectiv ity 割边/割点Net workFlow网络流Draw ing G raphs Nice ly 图的描绘Drawi ng Tr ees 树的描绘Plan arity Dete ction andEmbed ding平面性检测和嵌入Grap h Pro blems——h ard 图论-NP问题C lique最大团Ind epend ent S et 独立集V ertex Cove r 点覆盖Tr aveli ng Sa lesma n Pro blem旅行商问题Ha milto nianCycle Hami lton回路G raphParti tion图的划分Ver tex C olori ng 点染色E dge C olori ng 边染色G raphIsomo rphis m 同构Ste inerTreeStein er树Feed backEdge/Verte x Set最大无环子图Compu tatio nal G eomet ry 计算几何Conve x Hul l 凸包Tri angul ation三角剖分Vo ronoi Diag ramsVoron oi图Near est N eighb or Se arch最近点对查询R angeSearc h 范围查询P ointLocat ion 位置查询Inte rsect ion D etect ion 碰撞测试BinPacki ng 装箱问题Media l-Axi s Tra nsfor matio n 中轴变换P olygo n Par titio ning多边形分割Si mplif yingPolyg ons 多边形化简Sha pe Si milar ity 相似多边形Mot ion P lanni ng 运动规划Maint ainin g Lin e Arr angem ents平面分割Min kowsk i Sum Mink owski和S et an d Str ing P roble ms 集合与串的问题Se t Cov er 集合覆盖Set P ackin g 集合配置S tring Matc hing模式匹配App roxim ate S tring Matc hing模糊匹配Tex t Com press ion 压缩C rypto graph y 密码Fin ite S tateMachi ne Mi nimiz ation有穷自动机简化Long est C ommon Subs tring最长公共子串Short est C ommon Supe rstri ng 最短公共父串DP——Dyna mic P rogra mming——动态规划r ecurs ion ——递归A2A i ntegr ation A2A整合ab strac t 抽象的abstr act b ase c lass(ABC)抽象基类abs tract clas s 抽象类ab strac tion抽象、抽象物、抽象性ac cess存取、访问ac cesslevel访问级别acc ess f uncti on 访问函数acco unt 账户actio n 动作a ctiva te 激活ac tive活动的ac tualparam eter实参adap ter 适配器add-i n 插件ad dress地址addr ess s pace地址空间addr ess-o f ope rator取地址操作符ADL (argum ent-d epend ent l ookup)A DO(Ac tiveX Data Obje ct)Ac tiveX数据对象adv anced高级的aggre gatio n 聚合、聚集algor ithm算法alias别名alig n 排列、对齐alloc ate 分配、配置all ocato r分配器、配置器angl e bra cket尖括号anno tatio n 注解、评注API(App licat ion P rogra mming Inte rface)应用(程序)编程接口app d omain(app licat ion d omain)应用域app licat ion 应用、应用程序appli catio n fra mewor k 应用程序框架appe aranc e 外观app end 附加ar chite cture架构、体系结构arch ive f ile 归档文件、存档文件argu ment引数(传给函式的值)。
运算符与表达式:1.constant 常量2. variable 变量3. identify 标识符4. keywords 关键字5. sign 符号6. operator 运算符7. statement语句8. syntax 语法9. expression 表达式10. initialition 初始化11. number format 数据格式12 declaration 说明13. type conversion 类型转换14.define 、definition 定义条件语句:1.select 选择2. expression 表达式3. logical expression 逻辑表达式4. Relational expression 关系表达式5.priority优先6. operation运算7.structure 结构循环语句:1.circle 循环2. condition 条件3. variant 变量4. process过程5.priority优先6. operation运算数组:1. array 数组2. reference 引用3. element 元素4. address 地址5. sort 排序6. character 字符7. string 字符串8. application 应用函数:1.call 调用2.return value 返回值3.function 函数4. declare 声明5. `parameter 参数6.static 静态的7.extern 外部的指针:1. pointer 指针2. argument 参数3. array 数组4. declaration 声明5. represent 表示6. manipulate 处理结构体、共用体、链表:1 structure 结构2 member成员3 tag 标记4 function 函数5 enumerate 枚举6 union 联合(共用体)7 create 创建8 insert 插入9 delete 删除10 modify 修改文件:1、file 文件2、open 打开3、close 关闭4、read 读5、write 写6、error 错误序号主要章节常用英汉对照词汇备注1 运算符与表达式(operator and expression )汉语英语常量constant变量variable标识符identify关键字keywords符号sign运算符operator语句statement语法syntax表达式Expression初始化Initialization数据格式number format说明Declaration类型转换type conversion定义Define 、definition2 条件语句(conditionstatement) 选择select表达式expression逻辑表达式logical expression关系表达式Relational expression 优先priority运算operation结构structure3 循环语句(circle statement) 循环circle条件condition变量variant过程process优先priority运算operation4 函数(function) 调用call返回值return value函数function声明declare参数parameter静态的static外部的extern5 数组和指针(array andpointer) 数组array引用reference元素element地址address排序sort字符character字符串string应用application指针pointer参数argument数组array声明declaration表示represent处理manipulate6 结构体、共用体(structures 、union )结构structure 成员member标记tag函数function枚举enumerate联合( 共用体) union创建create插入insert删除delete修改modify7 文件(file) 文件file打开open关闭close读read写write错误errorProgram Design 程序设计writing program 编写程序standardize vt.使标准化coding the program 编程simplify vt.单一化,简单化programming 程序revision n.校订,修正programmer n.程序员occupy vt.占领,住进logic n.逻辑,逻辑学BASIC 初学者通用符号指令代码machine code 机器代码teaching language 教学语言debug n.DOS命令,调试simplicity n.单纯,简朴compactness a.紧凑的,紧密的timesharing system 分时系统description n.描述,说明interactive language 交互式语言break n.中断manufacturer n.制造业者structure chart 结构图dialect n.方言,语调the program flow 程序流expense n.费用,代价manager module 管理模块uniformity n.同样,划一worder module 工作模块archaic a.己废的,古老的mainmodule 主模块sufficient a.充分的,足够的submodule 子模块data processing 数据处理modify v.修正,修改business application 商业应用outline n.轮廓,概要scientific application 科学应用compose分解lexical a.字典的,词汇的code 代码non-programmer n.非编程人员node vt改为密码notation n.记号法,表示法,注释pseudocode n.伪代码verbosity n.唠叨,冗长commas n.逗点逗号record n.记录documentation 文档subrecord n.子记录flowchart/flow 程表/流程data division 数据部visual a.视觉的procedure division 过程部represent vt.表现,表示,代表comprise vt.包含构成structured techniques结构化技术operator n.运算符,算子straightforward a.笔直的,率直的commercial package 商业软件包subroutine n.子程序generator n.产生器,生产者driver module 驱动模块mathematician n.专家line by line 逐行operator n.作符translate vt.翻译,解释forerunner n.先驱modular 摸块化ancestor n.祖宗cumbersome a.讨厌的,麻烦的teaching programming 编程教学lengthy a.冗长的,漫长的alter vi./vt.改变flaw n.缺点裂纹devclop vt.发达separate a.各别的recompile v.编译assist n.帮助cycle n.循环technician n.技师remove vt.移动,除去straight line 直线category n.种类,类项rectangle n.长方形,矩形P-code p代码virtrally ad.事实上symology n.象征学象征的使用register n.寄存器to summaries 总之,总而言之by convention 按照惯例cyptic n.含义模糊的,隐藏的diamond-shaped a,菱形的bracket n.括号decision n判断obviate 除去,排除terminal n. a终端机,终端的keyword n.关键字card reader 阅读器underline vt.下划线translator program 译程序monadic a. monad(单位)的Programming 程序设计dec/binary n.二进制source language 源语shift 变化,转移,移位machine language 机器overflow n.溢出machine instruction 机器指令arithmetic n.算术,算法computer language 计算机语composite symbol 复合型符号.assembly language 汇编语assignment n.赋值floating point number浮点数proliferation n.增服high-level language高级语pointer n.指针natural language 自然语言array n.数组矩阵,source text 源文本subscript n.下标intermediate language 中间语言type conversion 类型转换software development 软件开发address arithmetic 地址运算map vt.映射,计划denote vt.指示,表示maintenance cost 维护费用subprogram n.子程序legibility n.易读性,易识别separate compilation 分离式编泽amend vt.修正,改善alphabetic a.照字母次序的consumer n.消费者digit n.数字位数enormous a.巨大的,庞大的numeric expression 数值表达式reliability n.可信赖性,可信度tap n.轻打,轻敲,选择safety n.安全,安全设备print zone 打印区property n.财产,所有权column n.列correctness n.正确,functionality n.机能semicolon n.分号portable a.叮携带的,可搬运的survey n.概观.altoggle n.肘节开关task n.作,任务declaration n.宣告说明source program 源程序mufti-dimension array 多维数组object program 目标程序其他提示语:CPU(Center Processor Unit)中央处理单元mainboard主板RAM(random accessmemory)随机存储器(内存)ROM(Read Only Memory)只读存储器Floppy Disk软盘Hard Disk硬盘CD-ROM光盘驱动器(光驱)monitor监视器keyboard键盘mouse鼠标chip芯片CD-R光盘刻录机HUB集线器Modem= MOdulator-DEModulator,调制解调器P-P(Plug and Play)即插即用UPS(Uninterruptable Power Supply)不间断电源BIOS(Basic-input-OutputSystem)基本输入输出系统CMOS(Complementary Metal-Oxide-Semiconductor)互补金属氧化物半导体setup安装uninstall卸载wizzard向导OS(Operation Systrem)操作系统OA(Office AutoMation)办公自动化exit退出edit编辑copy复制cut剪切paste粘贴delete删除select选择find查找select all全选replace替换undo撤消redo重做program程序license许可(证)back前一步next下一步finish结束folder文件夹Destination Folder目的文件夹user用户click点击double click双击right click右击settings设置update更新release发布data数据data base数据库DBMS(Data Base Manege System)数据库管理系统view视图insert插入object对象configuration配置command命令document文档POST(power-on-self-test)电源自检程序cursor光标attribute属性icon图标service pack服务补丁option pack功能补丁Demo演示short cut快捷方式exception异常debug调试previous前一个column行row列restart重新启动text文本font字体size大小scale比例interface界面function函数access访问manual指南active激活computer language计算机语言menu菜单GUI(graphical userinterfaces )图形用户界面template模版page setup页面设置password口令code密码print preview打印预览zoom in放大zoom out缩小pan漫游cruise漫游full screen全屏tool bar工具条status bar状态条ruler标尺table表paragraph段落symbol符号style风格execute执行graphics图形image图像Unix用于服务器的一种操作系统Mac OS苹果公司开发的操作系统OO(Object-Oriented)面向对象virus病毒file文件open打开colse关闭new新建save保存exit退出clear清除default默认LAN局域网WAN广域网Client/Server客户机/服务器ATM( AsynchronousTransfer Mode)异步传输模式Windows NT微软公司的网络操作系统Internet互联网WWW(World Wide Web)万维网protocol协议HTTP超文本传输协议FTP文件传输协议Browser浏览器homepage主页Webpage网页website网站URL在Internet的WWW服务程序上用于指定信息位置的表示方法Online在线Email电子邮件ICQ网上寻呼Firewall防火墙Gateway网关HTML超文本标识语言hypertext超文本hyperlink超级链接IP(Address)互联网协议(地址)SearchEngine搜索引擎TCP/IP用于网络的一组通讯协议Telnet远程登录IE(Internet Explorer)探索者(微软公司的网络浏览器)Navigator引航者(网景公司的浏览器)multimedia多媒体ISO国际标准化组织ANSI美国国家标准协会able 能activefile 活动文件addwatch 添加监视点allfiles 所有文件allrightsreserved 所有的权力保留altdirlst 切换目录格式andfixamuchwiderrangeofdiskproblems 并能够解决更大范围内的磁盘问题andotherinFORMation 以及其它的信息archivefileattribute 归档文件属性assignto 指定到autoanswer 自动应答autodetect 自动检测autoindent 自动缩进autosave 自动存储availableonvolume 该盘剩余空间badcommand 命令错badcommandorfilename 命令或文件名错batchparameters 批处理参数binaryfile 二进制文件binaryfiles 二进制文件borlandinternational borland国际公司bottommargin 页下空白bydate 按日期byextension 按扩展名byname 按名称bytesfree 字节空闲callstack 调用栈casesensitive 区分大小写causespromptingtoconfirmyouwanttooverwritean 要求出现确认提示,在你想覆盖一个centralpointsoftwareinc central point 软件股份公司changedirectory 更换目录changedrive 改变驱动器changename 更改名称characterset 字符集checkingfor 正在检查checksadiskanddisplaysastatusreport 检查磁盘并显示一个状态报告chgdrivepath 改变盘/路径node 节点npasswd UNIX的一种代理密码检查器,在提交给密码文件前,它将对潜在的密码进行筛选。
编译原理作业集-第七章(精选.)第七章语义分析和中间代码产⽣本章要点1. 中间语⾔,各种常见中间语⾔形式;2. 说明语句、赋值语句、布尔表达式、控制语句等的翻译;3. 过程调⽤的处理;4. 类型检查;本章⽬标掌握和理解中间语⾔,各种常见中间语⾔形式;各种语句到中间语⾔的翻译;以及类型检查等内容。
本章重点1.中间代码的⼏种形式,它们之间的相互转换:四元式、三元式、逆波兰表⽰;3.赋值语句、算术表达式、布尔表达式的翻译及其中间代码格式;4.各种控制流语句的翻译及其中间代码格式;5.过程调⽤的中间代码格式;6.类型检查;本章难点1. 各种语句的翻译;2. 类型系统和类型检查;作业题⼀、单项选择题:1. 布尔表达式计算时可以采⽤某种优化措施,⽐如A and B⽤if-then-else可解释为_______。
a. if A then true else B;b. if A then B else false;c. if A then false else true;d. if A then true else false;2. 为了便于优化处理,三地址代码可以表⽰成________。
a. 三元式b. 四元式c. 后缀式d. 间接三元式3. 使⽤三元式是为了________:a. 便于代码优化处理b. 避免把临时变量填⼊符号表c. 节省存储代码的空间d. 提⾼访问代码的速度4. 表达式-a+b*(-c+d)的逆波兰式是________。
a. ab+-cd+-*;b. a-b+c-d+*;c. a-b+c-d+*;d. a-bc-d+*+;5. 赋值语句x:=-(a+b)/(c-d)-(a+b*c)的逆波兰式表⽰是_______。
a. xab+cd-/-bc*a+-:=;a. xab+/cd-bc*a+--:=;a. xab+-cd-/abc*+-:=;a. xab+cd-/abc*+--:=;6. 在⼀棵语法树中结点的继承属性和综合属性之间的相互依赖关系可以由________来描述。
各种语言成分的语法及其翻译方案(示例)1. 普通声明语句的翻译下面是声明语句的文法:P→ prog id (input, output) D ; SD→D ; D | List : T | proc id D ; SList→List1, id | idT→ integer | real | array C of T1 | T1 | record DC → [num] C | ε声明语句的翻译模式:P→prog id (input, output){offset := 0}D ; SD→D ; DD→id: T{enter (, 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}2. 嵌套过程中声明语句的翻译嵌套过程声明语句的产生式。
P→prog id (input, output) D ; SD→D ; D | id : T | proc id ; D ; S(7.1) 嵌套过程声明语句的翻译模式:P→prog id (input, output) MD;S{addwidth(top(tblptr),top(offset));pop(tblptr);pop(offset)}M→ε{t := mktable(nil);push(t, tblptr); push(0, offset)}D→D1;D2D→proc id; N D1 ; S{t:= top(tblptr);addwidth(t, top(offset));pop(tblptr);pop(offset); enterproc(top(tblptr), ,t)} D→id : T{enter(top(tblptr), , T.type, top(offset));top(offset) := top(offset) + T.width}N→ε{t:= mktable(top(tblptr)); push(t, tblptr); push(0, offset)}3. 记录的翻译下面是生成记录类型的产生式:T→record D end生成记录类型的翻译模式:T→ record L D end {T.type := record(top(tblptr));T.width := top(offset);pop(tblptr); pop(offset)}L→ε{t:= mktable(nil); push(t, tblptr); push(0, offset)}4. 赋值语句的翻译下面是典型的赋值语句文法:S→Left := EE→E1 + E2 | E1 * E2 | - E1 | (E1 ) | LeftLeft→Elist ] | idElist→Elist, E | id [E(7.2) 赋值语句的翻译模式:⑴S→Left:=E{if Left.offset=null then/*Left是简单变量id*/gencode(Left.addr ':=' E.addr);elsegencode(Left.addr '[' Left.offset '] ' ':=' E.addr)} /*Left是数组元素*/⑵E→E1+E2{E.addr:=newtemp;gencode(E.addr ':='E1.addr'+'E2.addr)}⑶E→(E1){E.addr:= E1.addr}⑷E→Left{if Left.offset=null then /*Left是简单id*/E.addr:= Left.addrelse begin /*Left是数组元素*/E.addr:=newtemp;gencode(E.addr ':=' Left.addr ' [' Left.offset ']')end}⑸Left→Elist]{ Left.addr:=newtemp; /*Left是数组元素,因此存放基址和位移*/Left.offset:=newtemp;gencode(Left.addr ':=' c(Elist.array));gencode(Left.offset ':=' Elist.addr '*' width(Elist.array))}⑹Left→id{Left.addr:=id.addr; Left.offset:=null}⑺Elist→Elist1, E{t:=newtemp;m:= Elist1.ndim+1;gencode(t ':=' Elist1.addr '*' limit(Elist1.array, m)); /*计算e m-1×n m */gencode(t ':=' t '+' E.addr); /* 计算+i m*/Elist.array:= Elist1.array;Elist.addr:=t;Elist.ndim:=m}⑻Elist→id[E {Elist.array:=id.addr; Elist.addr:= E.addr; Elist.ndim:=1}5.各种控制结构的翻译5.1 布尔表达式的翻译布尔表达式的文法为:⑴B→B1or M B2⑵B→B1and M B2⑶B→not B1⑷B→(B1)⑸B→E1relop E2⑹B→true⑺B→false⑻M→ε布尔表达式的翻译模式如下所示:⑴B→B1or M B2{ backpatch(B1.falselist, M.quad);B.truelist := merge(B1.truelist, B2.truelist);B.falselist := B2.falselist}⑵B→B1and M B2{backpatch(B1.truelist, M.quad);B.truelist := B2.truelist;B.falselist := merge(B1.falselist, B2.falselist)}⑶B→not B1{B.truelist := B1.falselist; B.falselist := B1.truelist}⑷B→(B1) {B.truelist := B1.truelist; B.falselist := B1.falselist}⑸B→E1relop E2{B.truelist :=makelist(nextquad);B.falselist := makelist(nextquad+1);gencode('if' E1.addr relop.opE1.addr 'goto –');gencode('goto –')}⑹B→true{B.truelist := makelist(nextquad); gencode('goto –')}⑺B→false{B.falselist := makelist(nextquad); gencode('goto –')}⑻M→ε{M.quad := nextquad}5.2 常用控制流语句的翻译控制流语句if-then,if-then-else和while-do的文法为:⑴S→if B then S1⑵S→if B then S1else S2⑶S→while B do S1⑷S→begin L end⑸S→A⑹L→L1;S⑺L→S(7.9)if-then,if-then-else和while-do语句的翻译模式:⑴S→if B then M1S1N else M2S2{backpatch(B.truelist, M1.quad);backpatch(B.falselist, M2.quad);S.nextlist := merge(S1.nextlist, merge(N.nextlist, S2.nextlist))}⑵N→ε{N.nextlist := makelist(nextquad); gencode('goto –')}⑶M→ε{M.quad := nextquad}⑷S→if B then M S1{backpatch(B.truelist, M.quad);S.nextlist := merge(B.falselist, S1.nextlist)}⑸S→while M1B do M2S1{backpatch(S1.nextlist, M1.quad);backpatch(B.truelist,M2.quad);S.nextlist:=B.falselist; gencode('goto'M1.quad)}⑹S→begin L end{S.nextlist:=L.nextlist}⑺S→A{S.nextlist := nil}⑻L→L1;MS{backpatch(L1.nextlist, M.quad); L.nextlist := S.nextlist}⑼L→S{L.nextlist := S.nextlist}5.3 for循环语句的翻译for循环语句的文法如下所示:S→ for id := E1to E2step E3do S1for循环语句的翻译模式如下所示:S→ for id := E1to E2step E3do M S1 {backpatch(S1.nextlist, M.again,);gencode(‘goto’, -, -, M.again); S.nextlist := M.again;}M→ε {M.addr := entry(id); gencode(‘:=’, E1.addr, -, M.addr); T1:=newtemp;gencode(‘:=’, E2.addr, -, T1); T2:=newtemp; gencode(‘:=’, E3.addr, -, T2); q:=nextquad;gencode(‘goto’, -, -, q+2); M.again:=q+1; gencode(‘+’, M.addr, T2, M.addr);M.nextlist:=nextquad; gencode(‘if’M.addr‘>’T1‘goto–’);}5.4 repeat语句的翻译repeat语句的文法如下所示:S→ repeat S1until BRepeat语句的翻译模式如下所示:S→repeat M S1until N B{backpatch(B.falselist,M.quad);S.nextlist:=B.truelist}M→ε{M.quad := nextquad}N→ε{backpatch(S1.nextlist, nextquad)}6. switch语句的语法制导翻译switch语句的文法为:S→ switch (E ) ClistClist→ case V : S Clist | default : Sswitch语句的翻译模式如下所示:⑴S→switch (E){i:=0; S i.nextlist:=0; push S i.nextlist; push E.addr; push i; q:=0; push q}Clist{pop q;pop i;pop E.addr;pop S i.nextlist;S.nextlist:=merge(S i.nextlist, q); push S.nextlist} ⑵Clist→case V :{pop q; pop i; i:=i+1; pop E.addr;if nextquad≠0 then backpatch(q, nextquad);q:=nextquad;gencode(‘if’ E.addr‘≠’ V i‘goto’ L i);push E.addr; push i;push q}S{pop q; pop i; pop E.addr; pop S i-1.nextlist;p:=nextquad;gencode(‘goto -’); gencode(L i‘:’);S i.nextlist:=merge(S i.nextlist, p);S i.nextlist:=merge(S i.nextlist, S i-1.nextlist);push S i.nextlist; push E.addr; push i; push q}Clist⑶Clist→default :{pop q; pop i; i:=i+1; pop E.addr;if nextquad≠0 then backpatch(q, nextquad);q:=nextquad;gencode(‘if’ E.addr‘≠’ V i‘goto’ V i+1);push E.addr; push i;push q}S{pop q; pop i; pop E.addr; pop S i-1.nextlist;p:=nextquad;gencode(‘goto -’); gencode(L i‘:’);S i.nextlist:=merge(S i.nextlist, p);S i.nextlist:=merge(S i.nextlist, S i-1.nextlist);push S i.nextlist; push E.addr; push i; push q}7. 过程调用和返回语句的翻译过程调用和返回语句的文法如下所示:S→ call id(Elist)Elist→Elist, E | ES→ return E过程调用语句的翻译模式如下所示:⑴S→call id (Elist) {n :=0;repeatn:=n+1;从queue的队首取出一个实参地址p;gencode('param', -, -, p);until queue为空;gencode('call', id.addr, n, -)}⑵Elist→Elist, E{将E.addr添加到queue的队尾}⑶Elist→E{初始化queue,然后将E.addr加入到queue的队尾。