欢迎来到天天文库
浏览记录
ID:18257340
大小:56.50 KB
页数:16页
时间:2018-09-16
《清华大学软件学院编译原理课件pdf》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、清华大学软件学院编译原理课件pdf本文由今生恋露贡献pdf文档可能在WAP端浏览体验不佳。建议您优先选择TXT,或下载源文件到本机查看。THSS341001622010/4301PrinciplesofCompilation王朝坤IISE@TsinghuaTHSS341001622010/4301Chap.1IntroductionChaokunWangIISE@TsinghuaOutlineTHSS341001622010/4301What–什么是编译和编译器WhyCourseInfo.PL–编译与解释的
2、区别和联系HistoryContents编译各阶段的内容31.1Computer&SoftwareTHSS341001622010/43014CloudComputingTHSS341001622010/4301PigLatin–PigLatinisadataflowlanguageratherthanproceduralordeclarative.–Usercodeandexistingbinariescanbeincludedalmostanywhere.–Metadatanotrequired,but
3、usedwhenavailable.–Supportfornestedtypes.–OperatesonfilesinHDFS.5THSS341001622010/43016软件开发THSS341001622010/4301程序开发工具??如何从编辑器中的文本到可执行程序的??7Alanguage-processingsystemTHSS341001622010/43018Whatis…THSS341001622010/4301Compilation(编译)–Compilationistheprocessw
4、herebyonecomputerlanguageistranslatedintoanother(usuallysimplerandmorelowleveli.e.machineorientated)language–Traditionally,programsinahigh-levelcomputerlanguage(e.g.Pascal,C,Lisp)arecompiledintoassemblylanguage(essentiallymachinecode)Compiler(编译器)–Theprogr
5、amthatdoesthetranslationisknownasacompiler.9CompilersTHSS341001622010/4301Simplystated,acompilerisaprogramthatreadsaprogramwritteninonelanguage—thesourcelanguage—andtranslateitintoanequivalentprograminanotherlanguage—thetargetlanguage.Asanimportantpartofth
6、istranslationprocess,thecompilerreportstoitsuserthepresenceoferrorsinthesourceprogram.10PreprocessorsTHSS341001622010/4301Preprocessorsproduceinputtocompilers.Theymayperformthefollowingfunctions.Macroinclusion.Fileinclusion.“Rational”preprocessors.Language
7、extensions.11AssemblersTHSS341001622010/4301Somecompilersproduceassemblycodethatispassedtoanassemblerforfurtherprocessing.Othercompilersperformthejoboftheassembler,producingrelocatablemachinecodethatcanbepasseddirectlytotheloader/link-editor.Therelationshi
8、pbetweenassemblyandmachinecode–Assemblycodeismnemonicversionofmachinecode,–namesareusedinsteadofbinarycodesforoperations–namesarealsogiventomemoryaddress.12LoadersandLink-EditorsTHSS341001622010/4301Usually,a
此文档下载收益归作者所有