- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
Homework 1.2 Given the C assignment a[i+1] = a[i] + 2 draw a parse tree and a syntax tree for the expression, using the similar example as a guide. 0型文法:也叫短语结构文法或无限制文法,其描述能力相当于图灵机,可使用任何的语法描述形式; 1型文法:也叫上下文有关文法,其描述能力相当于线性有界自动机,语法形式如下: xSy - xAy 也就是说,S推导出A是和上下文x, y相关的,即S只有在上下文x, y的环境中才能推导出A; 2型文法:也叫上下文无关文法,其描述能力相当于下推自动机,语法形式如下: S - A S可以无条件的推导出A,和上下文无关,上下文无关文法因此得名; 3型文法:也叫正则文法,等价于正则表达式,其描述能力相当于有穷自动机,语法形式如下: S - Aa 其中最后一个a必须为非终结符。 * * Tanvir Chapter 1 Introduction Computer Science Technology Harbin Engineering University 1.1 Why Compilers? Compilers 编译器 Compilers are computer programs that translate one language to another . Very complex program from 10,000 to 1,000,000 lines of code. Its input is a program written in its source language. Usually, the source language is a high-level language (C, C++, etc). It produces an equivalent program written in its target language. The target language is object code (machine code) for the target machine. Compilers 编译器 Simple example: The source program of a compiler is as follows. I := I0+ L* 2 Target program: the output of compiler is an equivalent machine code of its source program. It looks like these. . MOVF id3, R2 MULF #2.0, R2 MOVF id2, R1 ADDF R2, R1 MOVF R1, id1 Machine Language 机器语言 Initially, the programs were written in machine language. numeric codes that represented the actual machine operations to be performed. C7 06 0000 0002 moves number 2 to the location 0000. Writing such codes is time consuming and tedious. Assembly Language 汇编语言 In assembly language instructions and memory locations are given symbolic forms. MOV X, 2 An assembler translates the symbolic
您可能关注的文档
最近下载
- 6-CFD基础及软件应用汇总课件.pptx VIP
- 移动通信职业规划.docx VIP
- 2024年杭州钱塘新区城市发展集团有限公司招聘真题 .pdf VIP
- 输日热加工禽肉及其产品动物卫生要求.pdf VIP
- 2025杭州钱塘新区城市发展集团有限公司社会招聘22人笔试备考题库及答案解析.docx VIP
- 药物分析与常用组学技术在药学服务中的应用题库答案-2025年华医网继续教育.docx VIP
- 海丰2022年事业编招聘考试《公共基础知识》真题及答案解析三.docx VIP
- 7、美国联邦法典第九卷联邦肉类检验法.doc VIP
- 2024年入团积极分子考试题库.docx VIP
- 《荷塘月色》课件25张 .ppt VIP
文档评论(0)