欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    (2.3)--Samuel's Ch1_1编译原理与实践英文版.ppt

    • 资源ID:96451935       资源大小:1.27MB        全文页数:21页
    • 资源格式: PPT        下载积分:15金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要15金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    (2.3)--Samuel's Ch1_1编译原理与实践英文版.ppt

    Chapter 1 Chapter 1 Introduction Introduction by the end of the lesson students will be able to make sure the mainframe of the compiler constructiontell the features of the problem computer can solveCompilerS2ObjectivesObjectivesCompilers 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.CompilerS3CompilersCompilersA person who knows and uses two languages.In everyday use the word bilingual usually means a person who speaks,reads,or understands two languages equally well(a balanced bilingual),but a bilingual person usually has a better knowledge of one language than of the other.CompilerS4BilingualBilingualEnglishSource languageCompilerS5CompilersCompilers一个能运用两种语言的人。一个能运用两种语言的人。在他的日常生活中能将一门外语和本族语基本等在他的日常生活中能将一门外语和本族语基本等同地运用于听、说、读、写,当然他的母语语言同地运用于听、说、读、写,当然他的母语语言知识和能力通常是大于第二语言的。知识和能力通常是大于第二语言的。CompilerS6双语双语ChineseTarget languageAn interpreter is a language translator like a compiler.The difference:the source program is executed immediately,not after translation is complete.CompilerS7Interpreters Interpreters The use of a second or foreign language in school for the teaching of content subjects.The use of the childs home language when the child enters school but later a gradual change to the use of the school language for teaching some subjects and the home language for teaching others.This is sometimes called maintenance bilingual education.CompilerS8Bilingual educationBilingual educationEnglishSource languageThe use of a second or foreign language in school for the teaching of content subjects.The use of the childs home language when the child enters school but later a gradual change to the use of the school language for teaching some subjects and the home language for teaching others.This is sometimes called maintenance bilingual education.CompilerS9Bilingual educationBilingual educationThe use of a second or foreign language in school for the teaching of content subjects.能在学校里使用第二语言或外语进行各门学科的教学。能在学校里使用第二语言或外语进行各门学科的教学。The use of the childs home language when the child enters school 学生刚进入学校时使用本族语学生刚进入学校时使用本族语but later a gradual change to the use of the school language for teaching some subjects 然后逐渐地使用第二语言进行部分学科的教学然后逐渐地使用第二语言进行部分学科的教学and the home language for teaching others.其它学科仍使用母语教学其它学科仍使用母语教学This is sometimes called maintenance bilingual education.这种模式称之为:保持型双语教学。这种模式称之为:保持型双语教学。CompilerS10Bilingual educationBilingual educationChinese?Target language?An interpreter is a language translator like a compiler.The difference:the source program is executed immediately,not after translation is complete.Programming language can be either interpreted or compiled.Interpreted languages:BASIC,LISP,JavaCompiled languages:FORTRAN,C,C+.Interpreters share many operations with compilers.CompilerS11Interpreters Interpreters 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.CompilerS12Machine Language Machine Language In assembly language instructions and memory locations are given symbolic forms.MOV X,2An assembler translates the symbolic codes and memory locations into corresponding numeric codes.Advantages:Great improvement in speed and accuracy of writing programs.Still used today.Disadvantages:Still not easy to write and difficult to read and understand.Machine dependent.CompilerS13Assembly LanguageAssembly LanguageNearly resembles mathematical notation or natural language.Independent on any particular machine.Capable of being translated into executable codeX=2Need a program that performs translation.Is it possible?Is generated object code efficient?CompilerS14High-level LanguagesHigh-level LanguagesNoam Chomskys study of the structure of natural languages.Classification of languages according to the complexity of their grammars and the algorithms to recognize them.Context-free grammars are the most useful for programming languages Study of the parsing problem,which become a standard part of compiler theory.Study of finite automata and regular expressions.Led to symbolic methods for expressing the structure of words of a programming languageOptimization techniques(code improvement techniques).CompilerS15Theoretical FoundationsTheoretical FoundationsWhat machine-independent optimizations are applicable to the following example?CompilerS16A Code Optimization ExampleA Code Optimization ExampleCompilerS17A Code Optimization Example:ResultA Code Optimization Example:ResultCompilers 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.It produces an equivalent program written in its target language.CompilerS18CompilersCompilersIf you wanna translate English into Chinese,how many steps will you follow?And what are they?The left sideOn the other hand,when you translate a Chinese sentence into an English one,what are you going to do?The right side Step by step,tell me the steps.CompilerS19Discussion 1Discussion 1CompilerS20Push the elephant into the refrigeratorPush the elephant into the refrigeratorGO!CompilerS21Translation ProcessTranslation ProcessThis is a book.Step 1:lexical analysisThis/is/a/book/.Step 2:syntax analysisThis subjectis predicatea quantifierbook object.endStep 3:semantic analysisThis pronoun 这is copula 是a numeral 一book noun 书.period 。Step 4:This is a book.Step 5:这是一书。Step 6:这是一本书。

    注意事项

    本文((2.3)--Samuel's Ch1_1编译原理与实践英文版.ppt)为本站会员(奉***)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

    本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开