- 165
- 0
- 约5.17千字
- 约 51页
- 2017-07-02 发布于浙江
- 举报
东南大学编译原理期末复习
Review 6.Important knowledge points Chapter 5 Attribute Annotated parsing tree Construct an annotated parsing tree for an expression (S-attribute) Syntax-directed definition S-attribute Grammar and evaluation of S-attribute Construct semantic rules for a S-attribute grammar Please construct an annotated parse tree for the input string 111.0111 where the syntax-directed definition is as following: Productions Semantic Rules S?L1.L2 {S.val=L1.val+L2.val/2L2.len} S?L {S.val=L.val} L?L1B {L.val=L1.val*2+B.val, L.len=L1.len+1} L?B {L.val=B.val,L.len=1} B?0 {B.val=0} B?1 {B.val=1} Review 6.Important knowledge points Chapter 6 Type Type expression Construct a type expression for a declaration Review 6.Important knowledge points Chapter 7 Stack-based storage allocation Activation Record Form C language program Recursive function Pascal language program Display Construct a maximum stack map for a C recursive program We assume that the storage organization and the form of activation record used in C language program run-time stack storage allocation are as above. Please construct the run-time stack map when it gets the maximum size for the following C program. The C program is as the following: #include stdio.h int x,y,z; int main() { x=35; y=40; z=f(x,y); } int f(int m, int n) { if (nm) { int t; t=f(n,m); return t } else if (n==0) return m; else { int t1,t2; t1=m % n; //remainder of m/n t2=f(n,t1); return t2 } } Notes: 1) Here we assume that the caller’s sp of Main function is the start address of global variable data area, and the returned address in the activation record of a function (including Main function) is filled by the operating system automatically, you might not care it. 2) The initial value of variable X and Y are 35 and 40 respectively, the start address of stack used in the program is K. Review 1.Structure of the cou
您可能关注的文档
- arm大学计划--共建生态教学.pdf
- sci讲座超经典.pdf
- “以情系人”专题学习讲座--第一课.pptx
- 《公共关系》课程设计.ppt
- 《形势与政策》中国周边安全.ppt
- 《钓鱼岛的战略价值》.ppt
- 专题八文学艺术复习课件.ppt
- 中世纪大学小组 定稿.ppt
- 中国矿业大学遥感实验报告.doc
- 从教改立项 说到成果凝炼陕职高.pdf
- 2025年全国演出经纪人员资格认定考试试卷带答案(研优卷).docx
- 2025年全国演出经纪人员资格认定考试试卷完整版.docx
- 2025年全国演出经纪人员资格认定考试试题库及完整答案.docx
- 2025年全国演出经纪人员资格认定考试试卷完美版.docx
- 2025年全国演出经纪人员资格认定考试试卷含答案(实用).docx
- 2025年全国演出经纪人员资格认定考试试卷及答案(各地真题).docx
- 2025年下半年内江市部分事业单位公开考试招聘工作人员(240人)备考题库附答案.docx
- 2025年全国演出经纪人员资格认定考试试卷及答案1套.docx
- 2025年下半年四川成都市郫都区面向社会引进公共类事业单位人员2人备考题库最新.docx
- 2025年下半年内江市部分事业单位公开考试招聘工作人员(240人)备考题库附答案.docx
最近下载
- GB45673-2025《危险化学品企业安全生产标准化通用规范》解读.pptx
- SH15-M-40010非晶合金变压器设计.docx VIP
- 青岛市2025-2026学年(上期)高三期末考试政治试卷(含答案).docx
- 2025届高考物理二轮复习热点题型归类-专题06 牛顿运动定律的综合应用(教师版).docx VIP
- ASTME8/E8M2021金属拉伸实验最新美标中文版.pdf VIP
- 中国美术水墨画课件.pptx VIP
- Why Nations Fail书.pdf VIP
- 【高考真题】全国2024年统一高考物理真题试卷(新课标)附解析.docx VIP
- 2025届高考物理热点题型归类专题11功和功率及动能定理的理解与应用讲义+变式演练.pdf
- 幼儿园小班手指游戏集(13个) 幼儿园小班游戏教案.doc VIP
原创力文档

文档评论(0)