英文翻译材料格式参考_第1页
英文翻译材料格式参考_第2页
英文翻译材料格式参考_第3页
英文翻译材料格式参考_第4页
英文翻译材料格式参考_第5页
已阅读5页,还剩10页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

英文翻译材料格式参考英文翻译材料格式参考 1 where tofind one or two numbers orsimple piecesof data in the main putermemory Random AessMemory or RAM 2 a simpleoperation to perform such asadding thetwonumbers together 3 where in themainmemory toput theresult ofthis simpleoperation and 4 where tofind thenext instructiontoperform While allexecutable programsare eventuallyread by the puterin machine language theyarenot allprogrammed inmachinelanguage It isextremely difficulttoprogramdirectly inmachinelanguagebecause theinstructions aresequences of1sand0s A typicalinstructionin amachinelanguage mightread1001011001011and meanadd the contents of storage registerA to the contentsof storage register B 2 High Level LanguagesHigh level languagesare relativelysophisticated setsof statementsutilizing wordsand syntaxfrom humanlanguage They aremore similarto normalhuman languagesthan assemblyor machine languages andare thereforeeasier touse forwriting plicatedprograms These programminglanguages allowlarger and more plicatedprograms to be developedfaster However high level languagesmust betranslatedintomachinelanguageby anotherprogram calleda pilerbefore aputer canunderstand them For thisreason programs written in ahigh level languagemay takelonger toexecute anduse upmore memorythan programswritten inan assembly language 3 Assembly LanguagesComputer programmersuse assembly languages tomake machine language programseasier towrite In anassembly language each statementcorresponds roughlyto onemachinelanguageinstruction An assemblylanguage statementis posedwith theaid ofeasy toremember mands The mandtoaddthe contentsof thestorageregisterA to thecontentsofstorageregister Bmight bewritten ADD B A ina typicalassemblylanguagestatement Assembly languagesshare certainfeatures withmachinelanguages For instance it ispossible tomanipulate specificbits inboth assemblyand machinelanguages Programmers useassembly languageswhen it is importantto minimizethe timeit takesto runa program because thetranslation fromassemblylanguagetomachinelanguage isrelatively simple Assembly languagesare alsoused whensome partof the puter hasto becontrolled directly such asindividual dotson amonitor orthe flowof individualcharacters toa printer III Classification ofHigh Level LanguagesHigh level languagesare monlyclassified asprocedure oriented functional object oriented or logic languages The mostmon high level languagestoday areprocedure oriented languages In theselanguages oneormore relatedblocks of statements that perform someplete functionare groupedtogether intoa programmodule or procedure and givena namesuch as procedure A If thesame sequenceof operationsis neededelsewhere in3the program a simplestatement canbe used to referback to the procedure In essence a procedureis justa mini program A largeprogram canbe constructedby groupingtogether proceduresthatperformdifferent tasks Procedural languagesallow programsto beshorter andeasier forthe puterto read but theyrequire the programmer todesign eachprocedure to be generalenough to beused in differentsituations Functional languagestreat procedureslike mathematicalfunctions andallow themto beprocessed likeany otherdataina program This allowsa muchhigher andmore rigorouslevelofprogram construction Functional languages also allowvariables symbols fordata thatcanbespecified andchanged bythe useras the program isrunning tobegiven valuesonly once This simplifiesprogramming byreducing theneed tobe concernedwith theexact orderofstatementexecution since a variable doesnot havetoberedeclared or restated each timeitisusedina programstatement Many of the ideasfrom functional languageshavebee keyparts ofmany modernprocedural languages Object oriented languagesare outgrowthsof functionallanguages In object oriented languages the codeused towrite theprogram and the dataprocessed bytheprogramare groupedtogether intounits calledobjects Objects arefurther groupedinto classes which defihe attributesobjects musthave A simpleexample ofa classis theclass Book Objects withinthis classmight beNovel andShort Story Objects alsohave certainfunctions associatedwith them called methods The puter aesses anobject throughthe useof oneoftheobject s methods The methodperforms someaction tothe datain theobject andreturns thisvalue totheputer Classes ofobjects canalso befurther groupedinto hierarchies in whichobjects ofone classcan inheritmethods fromanother class The structureprovided inobject oriented languagesmakes themvery usefulfor plicatedprogramming tasks Logic languagesuse logicas theirmathematical base A logicprogram consistsof setsof factsand if then rules which specifyhow oneset offacts maybe deduced from others for example If thestatement Xis true then thestatement Yis false In theexecution ofsuch a program an inputstatement canbe logicallydeducedfromother statementsin theprogram Many artificialintelligence programsarewrittenin suchlanguages IV Language Structureand ComponentsProgramminglanguagesuse specifictypesofstatements or instructions to providefunctional structuretotheprogram A statementina program is a basicsentence thatexpresses asimple idea its purposeis togive theputerabasic instruction Statements defihe typesof dataallowed how dataare tobe manipulated and theways thatprocedures andfunctions work Programmers usestatements tomanipulate monponents ofprogramminglanguages such as variables andmacros mini programs withinaprogram 4Statements knownas datadeclarations givenames andproperties toelements ofaprogramcalled variables Variables canbe assigneddifferent values within theprogram The propertiesvariables canhave arecalled types and theyinclude suchthings aswhat possiblevalues mightbe savedin the variables how muchnumerical auracyis tobeusedin thevalues and howone variablemay representa collectionof simplervalues inan organizedfashion such asa tableor array In manyprogramminglanguages a keydata typeis apointer Variables thatare pointersdonotthemselves havevalues instead they haveinformation thattheputercan useto locatesome othervariable that is they pointto anothervariable An expressionisapiece ofa statementthat describesa seriesof putationstobeperformed onsome oftheprogram svariables such asX Y Z in whichthevariablesare X Y and Zand theputations areaddition anddivision An assignmentstatement assignsavariablea valuederived fromsome expression while conditionalstatements specifyexpressions tobe testedand thenusedtoselect whichother statementsshould beexecuted next Procedure andfunction statementsdefine certainblocks ofcode asprocedures or functions thatcan thenbe returnedto laterin theprogram These statementsalso defihe kindsof variablesand parametersthe programmercan chooseandthetype ofvalue thatthe codewill returnwhen anexpression aessesthe procedureorfunction Many programminglanguagesalsopermit minitranslationprograms calledmacros Macros translatesegments ofcode thathave beenwrittenina languagestructure definedbytheprogrammer intostatements thatthe programminglanguage understands V History Programminglanguages dateback almosttotheinvention ofthe digitalputerin the1940s The firstassembly languagesemerged inthe late1950s withthe introductionof mercialputers The firstprocedural languageswere developedinthelate1950stoearly1960s FORTRAN created byJohn Backus and thenCOBOL created byGrace Hopper The firstfunctionallanguagewas LISP written byJohn McCarthyinthelate1950s Although heavilyupdated all threelanguagesarestill widelyused today In thelate1960s the firstobject oriented languages such asSIMULA emerged Logic languagesbecame wellknown inthe mid1970swiththe introductionof PROLOG a languageusedtoprogram artificialintelligence software During the1970s procedural languagescontinued todevelop withALGOL BASIC PASCAL C and Ada SMALLTALK wasa highlyinfluential object oriented languagethat ledtothemerging ofobject oriented andprocedural languagesin C andmorerecently inJAVA Although purelogiclanguageshave declinedin popularity variations havebee vitallyimportant inthe formof relationallanguages formodern databases such asSQL 1计算机语言与编程 一 引言在计算机科学中 编程语言是用来编写可被计算机运行的 一系列指令 计算机程序 的人工语言 与英语等自然语言相类似 编程语言具有词汇 语法和句法 然而 自然语言不适合计算机编程 因为它们能引起歧义 也就是 说它们的词汇和语法结构可以用多种方式进行解释 用于计算编程的语言必须具有简单的逻辑结构 而且它们的语法 拼写和标点符号的规则必须精确 编程语言在复杂性和通用程度上大相径庭 有些编程语言是为了处理特定类型的计算问题或为了用于特定型号 的计算机系统而编写的 例如 FORTRAN和COBOL等编程语言是为解决某些普遍的编程问题类 型而编写的 FORTRAN为了科学领域的应用 而COBOL为了商业领域的应用 尽管这些语言旨在处理特定类型的计算机问题 但是它们具有很高 的可移植性 也就是说它们可以用来为多种类型的计算机编程 其他的语言 譬如机器语言 是为一种特定型号的计算机系统 甚 至是一台特定的计算机 在某些研究领域使用而编写的 最常用的编程语言具有很高的可移植性 可以用于有效地解决不同 类型的计算问题 像C PASCAL和BASIC这样的语言就属于这一范畴 二 语言类型编程语言可划分为低级语言和高级语言 低级编程语言或机器语言 是编程语言中最基础的类型 能被计算 机直接理解 机器语言的区别取决于制造商和计算机的型号 高级语言是在计算机能够理解和处理之前必须首先翻译成机器语言 的编程语言 C C PASCAL和FORTRAN都是高级语言的例子 汇编语言是中级语言 非常接近于机器语言 没有其他高级语言所 表现出的语言复杂程度 但仍然得翻译成机器语言 1 机器语言在机器语言中 指令被写成计算机能够直接理解的被称 之为比特的1和0的序列 机器语言中的一条指令通常告诉计算机4件事情 1 到计算机主存储器 随机访问存储器 的哪个位置去找一或两 个数字或者简单的数据段 2 要执行的一个简单操作 例如将两个数字加起来 3 将这个简单操作的结果存放在主存储器的什么位置 以及 4 到哪里找要执行的下一条指令 虽然所有的可执行程序最终都是以机器语言的形式被计算机读取 但是它们并非都是用机器语言编写的 直接用机器语言编程极端困难 因为指令是1和0的序列 机器语言中的一条典型的指令可能是1001011001011 意思是将存储 寄存器A的内容加到存储寄存器B的内容中 2 高级语言2高级语言是利用人类语言中的词和句法的一套相对复 杂的语句 它们比汇编语言和机器语言更类似于正常的人类语言 因此用来编 写复杂的程序更容易 这些编程语言允许更快地开发更庞大和更复杂的程序 然而 在计算机能够理解之前 高级语言必须被称之为编译器的另 外一种程序翻译成机器语言 因为这个原因 与用汇编语言编写的程序比较起来 用高级语言编 写的程序可能运行的时间更长 占用的内存更多 3 汇编语言计算机编程人员使用汇编语言使机器语言程序编写起来 更简单一些 在汇编语言中 每条语句大致对应一条机器语言指令 汇编语言的语句是借助易于记忆的命令编写的 在典型的汇编语言的语句中 把存储寄存器A的内容加到存储寄存器 B的内容中这一命令 可以写成ADDB A 汇编语言与机器语言具有某些共同特征 例如 对特定的比特进行操作 用汇编语言和机器语言都是可行的 当尽量减少程序的运行时间很重要时 程序员就使用汇编语言 因 为从汇编语言到机器语言的翻译相对简单 当计算机的某个部分必须被直接控制时 如监视器上的单个点或者 流向打印机的单个字符 这时也使用汇编语言 三 高级语言的分类高级语言通常分为面向过程的 函数式的 面 向对象的或逻辑的语言 当今最常见的高级语言是面向过程的语言 在这种语言中 执行某个完整功能的一个或多个相关的语句块组成 一个程序模块或过程 而且被给予诸如 过程A 的名称 如果在程序的其他地方需要同样的操作序列 可以使用一个简单的 语句调回这个过程 实质上 一个过程就是一个小型程序 一个大程序可以通过将执行不同任务的过程组合在一起而构成 过程语言使程序变得比较短 而且更易于被计算机读取 但是要求 程序员将每个过程都设计得足够通用 能用于不同的情况 函数式语言像对待数学函数一样对待过程 并允许像处理程序中的 任何其他数据一样处理它们 这就使程序构造在更高 更严密的水平上得以实现 函数式语言也允许变量 在程序运行过程中可以被用户指定和更改的数据符号 只被赋值一次 这样 通过减少对语句执行的确切顺序给予关注的必要性 就简化 了编程 因为一个变量没有必要每次在一个程序语句中用到 都重 新定义或重新赋值 函数式语言的许多观点已经成为许多现代过程语言的关键部分 面向对象的语言是函数式语言的发展结果 在面向对象的语言中 用来编写程序的代码和程序处理的数据 组 合成叫做对象的单元 对象进一步组合成类 而类则定义对象必须具有的属性 类的一个简单例子就是书这个类 这个类中的对象可能是小说和短篇小说 对象还有某些与其相关的功能 称为方法 计算机通过使用对象的某种方法来使用这个对象 方法对对象中的数据执行某个操作 然后将值返回给计算机 对象的类也可更进一步组合成层 而在层中一个类的对象可继承另 一个类的方法 面向对象的语言中所提供的这种结构 使面向对象的语言对于复杂 的编程任务非常有用 逻辑语言将逻辑用作其数学基础 一个逻辑程序由一系列的事实与 如果 则 规则3组成 来具体 说明一系列事实如何可以从其他实事中推断出来 例如如果X语句为 真 则Y

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论