




已阅读5页,还剩12页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
翻译方案 翻译方案篇一:语言的语法及其翻译方案 各种语言成分的语法及其翻译方案(示例) 1. 普通声明语句的翻译 下面是声明语句的文法: P prog id (input, output) D ; S D D ; D | List : T | proc id D ; S List List1, id | id T integer | real | array C of T1 | ?T1 | record D C num C | 声明语句的翻译模式: Pprog id (input, output)offset := 0D ; S DD ; D Did: Tenter (, T.type, offset); offset:= offset + T.width TintegerT.type := integer; T.width := 4 TrealT.type :=real; T.width :=8 Tarray num of T1T.type := array(num.val, T1.type);T.width := num.valT1.width TT1T.type := pointer(T1.type); T.width := 4 2. 嵌套过程中声明语句的翻译 嵌套过程声明语句的产生式。 Pprog id (input, output) D ; S DD ; D | id : T | proc id ; D ; S (7.1) 嵌套过程声明语句的翻译模式: Pprog id (input, output) MD;Saddwidth(top(tblptr),top(offset); pop(tblptr);pop(offset) Mt := mktable(nil);push(t, tblptr); push(0, offset) DD1;D2 Dproc id; N D1 ; St:= top(tblptr);addwidth(t, top(offset);pop(tblptr); pop(offset); enterproc(top(tblptr), ,t) D id : Tenter(top(tblptr), , T.type, top(offset); top(offset) := top(offset) + T.width N t:= mktable(top(tblptr); push(t, tblptr); push(0, offset) 3. 记录的翻译 下面是生成记录类型的产生式: Trecord D end 生成记录类型的翻译模式: T record L D end T.type := record(top(tblptr); T.width := top(offset); pop(tblptr); pop(offset) L t:= mktable(nil); push(t, tblptr); push(0, offset) 4. 赋值语句的翻译 下面是典型的赋值语句文法: S Left := E E E1 + E2 | E1 * E2 | - E1 | (E1 ) | Left Left Elist | id Elist Elist, E | id E (7.2) 赋值语句的翻译模式: SLeft:=Eif Left.offset=null then /*Left是简单变量id*/ gencode(Left.addr := E.addr); else gencode(Left.addr Left.offset := E.addr) /*Left是数组元素*/ EE1+E2E.addr:=newtemp;gencode(E.addr := E1.addr + E2.addr) E(E1)E.addr:= E1.addr ELeftif Left.offset=null then /*Left是简单id*/ E.addr:= Left.addr else begin /*Left是数组元素*/ E.addr:=newtemp; gencode(E.addr := Left.addr Left.offset ) end LeftElist Left.addr:=newtemp; /*Left是数组元素,因此存放基址和位移*/ Left.offset:=newtemp; gencode(Left.addr := c(Elist.array); gencode(Left.offset := Elist.addr * width(Elist.array) LeftidLeft.addr:=id.addr; Left.offset:=null ElistElist1, Et:=newtemp;m:= Elist1.ndim+1; gencode(t := Elist1.addr * limit(Elist1.array, m); /*计算em-1nm */ gencode(t := t + E.addr); /* 计算+ im */ Elist.array:= Elist1.array; Elist.addr:=t; Elist.ndim:=m ElistidE Elist.array:=id.addr; Elist.addr:= E.addr; Elist.ndim:=1 5.各种控制结构的翻译 5.1 布尔表达式的翻译 布尔表达式的文法为: BB1 or M B2 BB1 and M B2 Bnot B1 B(B1) BE1 relop E2 Btrue Bfalse M 布尔表达式的翻译模式如下所示: BB1 or M B2 backpatch(B1.falselist, M.quad); B.truelist := merge(B1.truelist, B2.truelist); B.falselist := B2.falselist BB1 and M B2backpatch(B1.truelist, M.quad);B.truelist := B2.truelist;B.falselist := merge(B1.falselist, B2.falselist) Bnot B1B.truelist := B1.falselist; B.falselist := B1.truelist B(B1) B.truelist := B1.truelist; B.falselist := B1.falselist BE1 relop E2B.truelist :=makelist(nextquad);B.falselist := makelist(nextquad+1);gencode( if E1.addr relop.opE1.addr goto gencode( goto ) BtrueB.truelist := makelist(nextquad); gencode( goto ) BfalseB.falselist := makelist(nextquad); gencode( goto ) MM.quad := nextquad 5.2 常用控制流语句的翻译 控制流语句if-then,if-then-else和while-do的文法为: Sif B then S1 Sif B then S1 else S2 Swhile B do S1 Sbegin L end SA LL1;S LS(7.9) if-then,if-then-else和while-do语句的翻译模式: Sif B then M1 S1 N else M2 S2backpatch(B.truelist, M1.quad); backpatch(B.falselist, M2.quad); S.nextlist := merge(S1.nextlist, merge(N.nextlist, S2.nextlist) NN.nextlist := makelist(nextquad); gencode( goto ) MM.quad := nextquad Sif B then M S1backpatch(B.truelist, M.quad); S.nextlist := merge(B.falselist, S1.nextlist) Swhile M1 B do M2 S1backpatch(S1.nextlist, M1.quad); backpatch(B.truelist,M2.quad);S.nextlist:=B.falselist; gencode( goto M1.quad) Sbegin L endS.nextlist:=L.nextlist SAS.nextlist := nil LL1;MSbackpatch(L1.nextlist, M.quad); L.nextlist := S.nextlist LSL.nextlist := S.nextlist 5.3 for循环语句的翻译 for循环语句的文法如下所示: S for id := E1 to E2 step E3 do S1 for循环语句的翻译模式如下所示: S for id := E1 to E2 step E3 do M S1 backpatch(S1.nextlist, M.again,); gencode(goto, -, -, M.again); S.nextlist := M.again; M M.addr := entry(id); gencode(:=, E1.addr, -, M.addr); T1:=newtemp; gencode(:=, E2.addr, -, T1); T2:=newtemp; gencode(:=, E3.addr, -, T2); q:=nextquad; gencode(goto, -, -, q+2); M.again:=q+1; gencode(+, M.addr, T2, M.addr); M.nextlist:=nextquad; gencode(if M.addr T1goto ); 5.4 repeat语句的翻译 repeat语句的文法如下所示: S repeat S1 until B Repeat语句的翻译模式如下所示: Srepeat M S1until N Bbackpatch(B.falselist,M.quad); S.nextlist:=B.truelistMM.quad := nextquad Nbackpatch(S1.nextlist, nextquad) 6. switch语句的语法制导翻译 switch语句的文法为: S switch (E ) Clist Clist case V : S Clist | default : S switch语句的翻译模式如下所示: Sswitch (E)i:=0; Si.nextlist:=0; push Si.nextlist; push E.addr; push i; q:=0; push q Clistpop q;pop i;pop E.addr;pop Si.nextlist;S.nextlist:=merge(Si.nextlist, q); push S.nextlist Clistcase V :pop q; pop i; i:=i+1; pop E.addr; if nextquad 0 then backpatch(q, nextquad); q:=nextquad; gencode(if E.addr Vi goto Li); push E.addr; push i; push qSpop q; pop i; pop E.addr; pop Si-1.nextlist; p:=nextquad; gencode(goto -); gencode(Li:); Si.nextlist:=merge(Si.nextlist, p); Si.nextlist:=merge(Si.nextlist, Si-1.nextlist); push Si.nextlist; push E.addr; push i; push qClist Clistdefault :pop q; pop i; i:=i+1; pop E.addr; if nextquad 0 then backpatch(q, nextquad); q:=nextquad; gencode(if E.addr Vi goto Vi+1); push E.addr; push i; push qSpop q; pop i; pop E.addr; pop Si-1.nextlist; p:=nextquad; gencode(goto -); gencode(Li:); Si.nextlist:=merge(Si.nextlist, p); Si.nextlist:=merge(Si.nextlist, Si-1.nextlist); push Si.nextlist; push E.addr; push i; push q 7. 过程调用和返回语句的翻译 过程调用和返回语句的文法如下所示: S call id(Elist) Elist Elist, E | E S return E 过程调用语句的翻译模式如下所示: Scall id (Elist) n :=0; repeat n:=n+1; 从queue的队首取出一个实参地址p; gencode( param , -, -, p); until queue为空; gencode( call , id.addr, n, -) ElistElist, E将E.addr添加到queue的队尾 ElistE初始化queue,然后将E.addr加入到queue的队尾。 过程返回语句的翻译模式为: S return Eif 需要返回结果 then gencode(:=, E.addr, -, F); gencode(ret, -, -, -) 其中,F是存放结果的指定单元,四元式(ret, -, -, -)执行如下操作: 恢复主调程序的寄存器内容; 释放过程运行时所占用的数据区; 按返回地址返回到主调程序。 8. 输入输出语句的翻译 带I/O参数的程序语句和输入输出语句的文法如下所示: P prog id (input, output) D ; S S read (List) | readln(List) S write (Elist) | writeln(Elist) 带I/O参数的程序语句和输入输出语句的翻译方案如下所示: P prog id (Parlist) M D ; S Parlist input( | , output) S (read | readln) (N List); n:=0; repeat move(Queue, in); gencode(par, in, -, -); n:=n+1; until Queue为空; gencode(call, SYSIN, n-1, -); Listid, L (|List) S (write| writeln) (Elist); n:=0; repeat move(Queue, in); gencode(par, out, -, -); n:=n+1; until Queue为空; gencode(call, SYSOUT, n, w) /*n为输出参数个数,w是输出操作类型*/ EListE, K (|EList) M gencode(prog, id, y, -) /*y的值表示input,output或两者皆有*/ N 设置一个语义队列Queue L T:=entry(id); add(Queue, T) K T:= E.addr; add(Queue, T)翻译方案篇二:手册翻译方案 关于AFM、FCOM、QRH、SOP、FCTM手册编译方案 PlanATrados软件购入 优点:1、数据库较全面,专业术语集成,自动原格式沿用,节省人力物力,省时高效。 2、市面上专业翻译软件,很多航空公司选用,如东航、深航、藏航等。 预算:professional版本,采取账号收费,一个账号一次性30000结清,后期如有升级需要再选取付费7000-8000。提供远程培训,后续服务不收取费用。软件在合同签订后可以先使用软件,30个工作日内收到发票后付款即可。(已为最低费用) 软件购入安装用时:合同签订审批后2-3个工作日安装,远程培训熟悉后即可使用,最多两天时间即可投入使用。 所需人员配合:翻译后期手册格式微调需要两名运标部熟悉格式排版的人员配合。 手册翻译完成预计用时:软件安装使用后一周内完成翻译,之后进行手册格式调整,最多两周完成。 PlanB SOP手册:飞管部现有吉祥航空SOP可以借用,可否更改使用?是否需要其他公司SOP? PlanC人员手工翻译现状:五本手册内容非常多,需要尽可能短时间内完成。 整体:尽量找其他公司现存同机型或同系列手册进行对比改动,需要公司内部大量具备英语基础的同事协助;找不到现存手册的,人工翻译后校对。 1、QRH:手册共需翻译两个机型,6156和6268。 所需人员配合:监控飞行员较熟悉,申请有经验的四个副驾,分两组,各负责一个机型。 2、FCOM:手册内容有四千多页,需要大量人手协助。分章节翻译。 所需人员配合:初步定为四个机长、四个副驾、两个机务,后期根据章节调整,可能需要更多。 3、FCTM+AFM:两部手册牵涉内容较多,需要多部门配合,优先翻译FCTM,后翻译AFM。所需人员:航务部、客舱部、机务部、飞管部、运标部各一人+一名机长 所需人员配合:飞管部负责,后期需运标部配合修改。 手册翻译完成预计用时:预计用时一个月。任务细化,两周内译完,后两周:一周时间译文校对,后一周手册格式排版整理。 补充说明:时间紧迫,工作量大,希望公司同事能给予最大程度的支持。QRH、FCTM、AFM均由所需配合人员主译,飞翻校对,FCOM飞翻参与翻译,SOP飞翻主译。翻译方案篇三:中英文对照工程施工方案 第八章 各分部分项工程的施工方案 Chapter 8 Construction Scheme of Subprojects 8.1 土建施工方案 8.1 Civil Engineering Construction Scheme 8.1.1 工程测量 8.1.1 Engineering Surveying 1) 测量概述 1) Measurement Overview 为满足工程施工特点,该工程的测量控制网按照“从整体到局部,高精度控制低精度”的原则,由高到低设置三级控制网,各级控制网相互衔接,统一为整体系统。 In order to meet the characteristics of construction, the survey control networks of the project have three levels from high to low in accordance with the principle “From the whole to the part; High precision controls low precision”. Control networks at all levels should be connected, thus forming the overall system. 1、 测量注意事项 1. Measurement Considerations 建筑物占地面积超大,这对轴线控制网的布设和投测带来难度,需要充分利用高精度电子全站仪进行轴线控制网的布设及细部测量放线,钢尺作为辅助;轴线投测时,仪器要架设在建筑物两端,以减少投测误差。 As the buildings occupy a large area, which brings difficulty to the layout design and measurement of the axis control network, the electronic total station with high precision should be used to lay the network and do detailed survey with steel rulers as assistive devices. When transfer of building lines is conducted, instruments should be erected on both ends of the buildings to minimize measuring errors. 2、 测量前准备工作 2. Preparations before measurement (1)、测量仪器检定:本工程使用的所用测量仪器及工具(包括专业分包的测量仪器)均应经国家计量单位检校合格并在有效时间之内。 (1) Measuring instrument calibration: All measuring instruments and tools (including those used in professional subcontracts) should be examined and calibratedby the national units of measurement and meet the standards within the effective time. (2)、校核图纸:总图校核,包括建筑物定位依据及条件;校核建筑图、结构图、机电图纸是否对应。 (2) Checking drawings: Check the general drawing, including the position basis and conditions of buildings; Check whether architectural drawings, structural drawings and electrical mechanical drawings correspond to one another. (3)、根据建筑总平面要求,对勘测部门提供的坐标点和水准点进行复核,确保工程测量的准确性。 (3) Check the coordinate points and benchmarks given by Planning Survey department in accordance with the requirements of the building general layout and ensure the accuracy of engineering surveying. (4)、施测用辅助如标高控制桩油漆、麻线等提前准备到位。 (4) Auxiliary measuring materials should be prepared in advance in place, such as elevation control pile paint, twine, etc. (5)、测量仪器及人员准备:成立测量组组长,负责整个工程的测量与验线工作。人员、仪器配置如下: (5) Preparation of measuring instruments and personnel: Appoint a team leader in charge of the measurement and checking of building lines of the whole project. Personnel and instrument configurations are as follows: 测量组: Measurement group: 技术组3人,负责编制测量/作业指导书,内业管理,收集检查施工测量数据,控制网及高程网的测设与校核。 Technology group: 3 persons, responsible for preparing the measurement program / work instructions, doing interior management, collecting and checking the construction survey data, and measuring and checking the control network and the height net. 放线组6人,负责测量放线。 Group for setting building lines: 6 persons, responsible for measurement andsetting out. 验线组3人,负责测量放线的检查和验收。 Group for checking building lines: 3 persons, responsible for checking and accepting measurement and setting out. 2) 控制系统的建立 2) The establishment of the control system 1、 控制网的分级 1. Grading of the control network 平面控制网是土建、钢结构、机电安装、沉降及变形观测施工测量的依据,也是监理等各检测单位复查的基准。布网原则:遵循“从整体到局部,先控制后碎部”的原则。布网要求:各级平面控制点可靠、稳定、使用方便;通视条件好,检校方便,满足施工精度要求。由于该工程量巨大,而且工况复杂,因而必须设置多级平面控制网,而且各级控制网之间必须形成有机的整体。由此本工程建立三级平面控制网。 The horizontal control network is the construction surveying basis for civil engineering, steel structures, mechanical and electrical installation, subsidence and deformation observations, and it is also the checking benchmark for the supervising unit and other detection units. The principle for setting the network is “From the whole to the part; first control and then smash each part”. The requirements for setting the network are as follows: horizontal control points at all levels should be reliable, stable and easy to use; the points should have good intervisibility, can be checked conveniently and meet the construction accuracy requirements. Due to the large work amount and complex working conditions, multi-level horizontal control networks should be set up and networks at all levels must form an organic whole. The project sets up a three-level horizontal control network. (1) 首级平面控制网 (1) Horizontal control network at the primary level 首级平面控制网是在业主提供的一级坐标点(其坐标见下表)基础上,根据建筑物的总平面定位图,建立一个稳定可靠,不受施工影响的施工控制网。The horizontal control network at the primary level is based on the coordinate points provided by the proprietor (see the following table). In line with the general layout positioning map, a reliable construction control network, free from the influence of construction, is established. 该控制网作为首级平面控制网,它是二级平面控制网建立和复核的唯一依据,也是幕墙装修测量、机电安装测量、沉降及变形观测的唯一依据,在整个工程施工期间,必须保证这个控制网的稳定可靠。该控制点的设置位置选择在稳定可靠处,用水泥钢钉打入硬化路面,作为标记,并用红油漆标注。若是未硬化处,要浇注混凝土,并设置保护装置。 This net
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 个人土地承包合同资料
- 服装设计师的创意职业规划
- 智能运维领域行业研究报告:多语言技术应用前景分析
- 山东省莱城区刘仲莹中学2026届八年级数学第一学期期末调研试题含解析
- 2025设备租赁合同范本版
- 2026届山东省郯城育才中学数学七上期末学业水平测试模拟试题含解析
- 邮储银行三门峡市义马市2025秋招英文结构化面试题库含答案
- 邮储银行铜陵市枞阳县2025秋招笔试法律专练及答案
- 邮储银行上海市浦东新区2025秋招笔试英语阅读理解题专练30题及答案
- 工商银行安阳市汤阴县2025秋招笔试管理营销专练及答案
- 医科大学第一附属医院吊塔采购项目方案投标文件(技术方案)
- 石材购销合同范本简单
- 数据结构(Java语言描述)(第2版)课件全套 张静 单元1-8 数据结构与算法 - 哈希表
- 眼科规培汇报总结
- 2026版创新设计高考总复习语文部编版-测评练案答案
- 生活垃圾教学课件
- 2025年 山东中烟工业有限责任公司招聘考试笔试试卷附答案
- 高速公路收费系统施工技术指南
- 【核心素养目标】《燕歌行并序》公开课一等奖创新教学设计 统编版高中语文选择性必修中册
- 小学五年级语文阅读理解考场答题技巧方法公式步骤复习课件
- 浙江省绍兴市越城区绍兴市第一初级中学2024-2025学年九年级上学期10月月考科学试题
评论
0/150
提交评论